Skip to content

Conversation

@prishajaiswal75
Copy link
Contributor

@prishajaiswal75 prishajaiswal75 commented Jan 4, 2026

Description

This PR replaces deprecated AccountCreateTransaction.set_key() usage
with the appropriate non-deprecated alternatives across examples.

Changes

  • Replace deprecated set_key() calls
  • Use set_key_without_alias() and set_key_with_alias() where applicable
  • Ensure examples align with current SDK best practices

Notes

This PR is opened from a clean branch to avoid unrelated historical commits.

Fixes #1170

@github-actions
Copy link

github-actions bot commented Jan 4, 2026

[commit-verification-bot]
Hi, this is VerificationBot.
Your pull request cannot be merged as it has unverified commits.
View your commit verification status: Commits Tab.

To achieve verified status, please read:

Remember, you require a GPG key and each commit must be signed with:
git commit -S -s -m "Your message here"

Thank you for contributing!

From the Hiero Python SDK Team

@prishajaiswal75 prishajaiswal75 force-pushed the fix/deprecate-set-key-clean branch from 1cbc559 to c576538 Compare January 4, 2026 22:00
@coderabbitai
Copy link

coderabbitai bot commented Jan 4, 2026

📝 Walkthrough

Walkthrough

Replaced deprecated AccountCreateTransaction.set_key() usages with new methods: set_key_without_alias() across docs, examples, and tests; added set_key_with_alias() for alias-specific scenarios. No other behavioral or control-flow changes were introduced.

Changes

Cohort / File(s) Summary
Changelog
CHANGELOG.md
Documented replacement of deprecated set_key() with set_key_without_alias() and addition of set_key_with_alias().
Public API
src/hiero_sdk_python/account/account_create_transaction.py
Added set_key_without_alias(...) and set_key_with_alias(...) to AccountCreateTransaction.
Documentation
docs/sdk_users/running_examples.md
Example updated to call set_key_without_alias() instead of set_key().
Examples — Account / Consensus / Logger / Query / Schedule / Tokens / Transaction
examples/account/..., examples/consensus/..., examples/logger/..., examples/query/..., examples/schedule/..., examples/tokens/..., examples/transaction/...
Replaced AccountCreateTransaction.set_key(...) calls with set_key_without_alias(...) in account-creation flows across examples (multiple files under the listed directories).
Tests — Integration
tests/integration/...
Migrated integration test call sites from set_key(...) to set_key_without_alias(...) (e.g., account_info_query_e2e_test.py, query_e2e_test.py, token_*_e2e_test.py, etc.).
Tests — Unit
tests/unit/...
Updated unit tests to use set_key_without_alias(); added/retained set_key_with_alias() coverage for alias-related tests (e.g., account_create_transaction_test.py, executable_test.py).
Test Utilities
tests/integration/utils.py
Replaced helper usage of set_key() with set_key_without_alias() for account creation flows.

Sequence Diagram(s)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive The PR addresses issue #1170's core objective to replace deprecated set_key() with set_key_without_alias() across examples and tests; however, the PR currently has unresolved merge requirements including GPG-signed commits and a syntax error flagged by the reviewer. Complete required commit signing (GPG + DCO), fix the reported syntax error (.set_account_memo), and rebase the branch to resolve merge blockers before finalizing.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely summarizes the main change: replacing deprecated AccountCreateTransaction.set_key() usage with non-deprecated alternatives.
Description check ✅ Passed The PR description accurately explains the changes: replacing deprecated set_key() calls with set_key_without_alias() and set_key_with_alias() across examples, and references the related issue #1170.
Out of Scope Changes check ✅ Passed All code changes are focused on replacing set_key() with set_key_without_alias() or set_key_with_alias() across examples and tests, which is directly in scope with the stated PR objectives and issue #1170.
Docstring Coverage ✅ Passed Docstring coverage is 82.67% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eaa39d9 and 1c0c3a9.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • tests/unit/account_create_transaction_test.py
🧰 Additional context used
📓 Path-based instructions (1)
tests/unit/**/*

⚙️ CodeRabbit configuration file

tests/unit/**/*: You are acting as a senior maintainer reviewing unit tests for the hiero-sdk-python project. Your goal is to ensure tests are extensive, deterministic, and protect against breaking changes.

CRITICAL PRINCIPLES - Tests Must Fail Loudly & Deterministically:

  • Tests must provide useful error messages when they fail for future debugging.
  • No print() statements - use assertions with descriptive messages.
  • No timing-dependent or unseeded random assertions.
  • No network calls or external dependencies (unit tests are isolated).
  • No unjustified TODOs or skipped tests without tracking issues.

PRIORITY 1 - Protect Against Breaking Changes:

  • Assert public attributes exist (e.g., assert hasattr(obj, 'account_id')).
  • Assert return types where relevant (e.g., assert isinstance(result, AccountId)).
  • Assert fluent setters return self (e.g., assert tx.set_memo("test") is tx).
  • Assert backward-compatible defaults are maintained.
  • If a breaking change is introduced, tests must assert deprecation behavior and test old behavior until removal.

PRIORITY 2 - Constructor & Setter Behavior:

  • Test constructor behavior with valid inputs, edge cases, and invalid inputs.
  • Test setter behavior including method chaining (fluent interface).
  • Verify that setters validate input and raise appropriate exceptions.
  • Test that getters return expected values after construction/setting.

PRIORITY 3 - Comprehensive Coverage:

  • Unit tests should be extensive - test even if we don't expect users to use it currently.
  • Cover happy paths AND unhappy paths/edge cases.
  • Test boundary conditions, null/None values, empty collections, etc.
  • Avoid brittle ordering assertions unless order is part of the contract.

PRIORITY 4 - No Mocks for Non-Existent Modules:

  • All imports must reference actual SDK modules - no hallucinated paths.
  • Validate import paths against the actual src/hiero_sdk_python structure.
  • Mocks should only be used for external de...

Files:

  • tests/unit/account_create_transaction_test.py
🧠 Learnings (1)
📓 Common learnings
Learnt from: github-actions[bot]
Repo: hiero-ledger/hiero-sdk-python PR: 0
File: :0-0
Timestamp: 2026-01-08T10:28:14.391Z
Learning: In hiero-ledger/hiero-sdk-python, examples should prefer Client.from_env() (src/hiero_sdk_python/client/client.py) for client setup. For examples under examples/tokens, replace manual Network/AccountId/PrivateKey + load_dotenv() bootstrapping with Client.from_env(), and use client.operator_account_id and client.operator_private_key instead of passing operator_id/operator_key through functions.
🧬 Code graph analysis (1)
tests/unit/account_create_transaction_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (3)
  • set_key_without_alias (94-107)
  • AccountCreateTransaction (27-380)
  • set_alias (220-244)
🪛 Ruff (0.14.10)
tests/unit/account_create_transaction_test.py

388-388: pytest.raises(ValueError) is too broad, set the match parameter or use a more specific exception

(PT011)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (4)
CHANGELOG.md (1)

153-154: LGTM! Changelog entry accurately documents the deprecation replacement.

The changelog entry clearly describes the replacement of deprecated set_key() usage across examples and tests with the new methods. The scope and nature of the change are well documented.

tests/unit/account_create_transaction_test.py (3)

45-45: LGTM! Correct replacement of deprecated method across basic account creation tests.

All basic account creation tests correctly replace set_key() with set_key_without_alias(), which is appropriate for these scenarios where no alias functionality is required. The method chaining and test behavior are preserved.

Also applies to: 70-70, 105-105, 170-170, 190-190, 237-237


334-335: LGTM! Correct usage pattern for testing independent alias setting.

These tests correctly use set_key_without_alias() followed by separate set_alias() calls, which validates the independent alias-setting API. This pattern is appropriate for testing the set_alias() method in isolation.

Also applies to: 360-361, 386-386, 394-394


505-525: LGTM! Important test validates alias clearing behavior.

This test correctly verifies that set_key_without_alias() clears any previously set alias, which is the expected behavior documented in the method contract. The assertion at line 525 confirms the alias is properly set to None.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@exploreriii
Copy link
Contributor

have you set up a GPG key and attached it to your github account in the correct place?

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (14)
tests/integration/revenue_generating_topics_e2e_test.py (3)

1-985: Consider adding resource cleanup to prevent state accumulation.

Integration tests create accounts, topics, and tokens but lack explicit teardown. Over time, this can accumulate state on the test network, potentially causing resource exhaustion or increased costs.

Recommendations:

  • Add pytest fixtures with teardown (e.g., @pytest.fixture(scope="function")) to delete created topics and accounts
  • Or implement a cleanup phase at the end of each test that deletes resources
  • Consider using a context manager pattern for resource lifecycle management

Based on coding guidelines (PRIORITY 3 - Isolation & Cleanup).


331-331: Strengthen balance assertions for better failure diagnosis.

Several balance assertions use inequality checks that verify direction (fee charged/not charged) but don't validate exact amounts:

  • Lines 331, 381: balance < hbar_amount // 2 - verifies fee was charged but not the exact amount
  • Lines 560, 799-802: balance > hbar_amount // 2 - verifies fee was NOT charged but imprecise

Recommendation:
Consider asserting expected exact balances or tighter ranges. For example:

# More precise assertion
expected_balance = hbar_amount - (hbar_amount // 2) - transaction_fee
assert abs(account_info.balance.to_tinybars() - expected_balance) < tolerance

This would catch scenarios where fees are partially applied or miscalculated, improving regression detection when tests fail in CI.

Based on coding guidelines (PRIORITY 4 - Assertions & Coverage).

Also applies to: 381-381, 560-560, 799-802


1-985: Consider splitting into smaller test modules.

At 985 lines with 17 test functions, this file is quite monolithic. Splitting by feature area would improve maintainability and test discovery:

Suggested structure:

  • revenue_topics_create_update_test.py - creation and update tests
  • revenue_topics_hbar_fees_test.py - HBAR fee charging tests
  • revenue_topics_token_fees_test.py - token fee charging tests
  • revenue_topics_exempt_keys_test.py - fee exemption tests
  • revenue_topics_limits_test.py - limit and error condition tests

This would make it easier to run specific test subsets and locate relevant tests when debugging failures.

Based on coding guidelines (PRIORITY 2 - Test Structure & Maintainability).

examples/tokens/token_wipe_transaction.py (1)

10-18: Optional: Consider consistent import style for transaction classes.

TokenAssociateTransaction is imported from the top level (line 17), while AccountCreateTransaction uses a fully qualified path (line 18). For consistency, consider importing both the same way if AccountCreateTransaction is available at the package level.

examples/logger/logging_example.py (1)

110-125: Missing explicit ResponseCode.SUCCESS validation.

The transaction executes correctly, but per SDK example guidelines, receipt status should be explicitly validated against ResponseCode.SUCCESS rather than relying solely on exception handling. Other examples in this PR demonstrate the recommended pattern.

🔎 Suggested improvement
     try:
         receipt = transaction.execute(client)
+        if receipt.status != ResponseCode.SUCCESS:
+            print(f" Account creation {description}failed: {ResponseCode(receipt.status).name}")
+            return None
         account_id = receipt.account_id
         print(f" Account creation {description}successful. Account ID: {account_id}")
         return str(account_id)
     except Exception as e:
         print(f" Account creation {description}failed: {str(e)}")
         return None

Note: You'll need to add ResponseCode to the imports at line 17.

examples/query/transaction_record_query.py (1)

54-75: Consider adding explicit freeze_with(client) for user clarity.

The set_key_without_alias() migration is correct and receipt validation is present. However, per example guidelines emphasizing "explicitness over brevity," consider adding .freeze_with(client) before .execute(client) to demonstrate the complete transaction lifecycle pattern that users should follow.

🔎 Suggested improvement
     # Create the account
     receipt = (
         AccountCreateTransaction()
         .set_key_without_alias(new_account_key.public_key())
         .set_initial_balance(Hbar(1))
+        .freeze_with(client)
         .execute(client)
     )
tests/integration/transaction_record_query_e2e_test.py (1)

102-103: Missing @pytest.mark.integration decorator.

This test function lacks the @pytest.mark.integration marker that the other two test functions in this file have. This inconsistency could cause the test to be skipped or run unexpectedly depending on pytest configuration.

🔎 Proposed fix
+@pytest.mark.integration
 def test_transaction_record_query_can_execute_fungible_transfer():
     env = IntegrationTestEnv()
examples/tokens/account_allowance_approve_transaction.py (1)

51-57: Critical: Missing freeze_with(client) before execute(client).

The transaction lifecycle is incomplete. Per SDK best practices, freeze_with(client) must be called before execute(client) to properly finalize the transaction before submission.

🔎 Proposed fix
     account_receipt = (
         AccountCreateTransaction()
         .set_key_without_alias(account_public_key)
         .set_initial_balance(Hbar(1))
         .set_account_memo("Account for token allowance")
+        .freeze_with(client)
         .execute(client)
     )
examples/tokens/token_revoke_kyc_transaction.py (1)

2-3: Fix typo in usage docstring.

The filename has duplicate .py extensions in the usage examples, which will cause copy-paste errors for users.

🔎 Proposed fix
-uv run examples/tokens/token_revoke_kyc_transaction.py.py
-python examples/tokens/token_revoke_kyc_transaction.py.py
+uv run examples/tokens/token_revoke_kyc_transaction.py
+python examples/tokens/token_revoke_kyc_transaction.py
tests/integration/account_update_transaction_e2e_test.py (5)

186-186: Incomplete migration: deprecated set_key() still in use.

Line 186 still uses the deprecated set_key() method. For consistency with the rest of this PR, it should be migrated to set_key_without_alias().

🔎 Suggested fix
-        .set_key(env.operator_key.public_key())
+        .set_key_without_alias(env.operator_key.public_key())

238-238: Incomplete migration: deprecated set_key() still in use.

Line 238 still uses the deprecated set_key() method. For consistency with the rest of this PR, it should be migrated to set_key_without_alias().

🔎 Suggested fix
-        .set_key(env.operator_key.public_key())
+        .set_key_without_alias(env.operator_key.public_key())

276-276: Incomplete migration: deprecated set_key() still in use.

Line 276 still uses the deprecated set_key() method. For consistency with the rest of this PR, it should be migrated to set_key_without_alias().

🔎 Suggested fix
-        .set_key(env.operator_key.public_key())
+        .set_key_without_alias(env.operator_key.public_key())

305-305: Incomplete migration: deprecated set_key() still in use.

Line 305 still uses the deprecated set_key() method. For consistency with the rest of this PR, it should be migrated to set_key_without_alias().

🔎 Suggested fix
-        .set_key(env.operator_key.public_key())
+        .set_key_without_alias(env.operator_key.public_key())

383-383: Incomplete migration: deprecated set_key() still in use.

Line 383 still uses the deprecated set_key() method. For consistency with the rest of this PR, it should be migrated to set_key_without_alias().

🔎 Suggested fix
-        .set_key(env.operator_key.public_key())
+        .set_key_without_alias(env.operator_key.public_key())
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7f35aef and c576538.

📒 Files selected for processing (53)
  • CHANGELOG.md
  • docs/sdk_users/running_examples.md
  • examples/account/account_allowance_approve_transaction_hbar.py
  • examples/account/account_allowance_approve_transaction_nft.py
  • examples/account/account_allowance_delete_transaction_hbar.py
  • examples/account/account_allowance_delete_transaction_nft.py
  • examples/account/account_create_transaction.py
  • examples/account/account_delete_transaction.py
  • examples/account/account_records_query.py
  • examples/account/account_update_transaction.py
  • examples/consensus/topic_create_transaction_revenue_generating.py
  • examples/logger/logging_example.py
  • examples/query/account_balance_query_2.py
  • examples/query/account_info_query.py
  • examples/query/transaction_get_receipt_query.py
  • examples/query/transaction_record_query.py
  • examples/schedule/schedule_create_transaction.py
  • examples/schedule/schedule_delete_transaction.py
  • examples/schedule/schedule_info_query.py
  • examples/schedule/schedule_sign_transaction.py
  • examples/tokens/account_allowance_approve_transaction.py
  • examples/tokens/token_airdrop_claim_auto.py
  • examples/tokens/token_airdrop_claim_signature_required.py
  • examples/tokens/token_airdrop_transaction.py
  • examples/tokens/token_airdrop_transaction_cancel.py
  • examples/tokens/token_associate_transaction.py
  • examples/tokens/token_create_transaction_freeze_key.py
  • examples/tokens/token_create_transaction_kyc_key.py
  • examples/tokens/token_create_transaction_max_automatic_token_associations_0.py
  • examples/tokens/token_create_transaction_pause_key.py
  • examples/tokens/token_create_transaction_wipe_key.py
  • examples/tokens/token_dissociate_transaction.py
  • examples/tokens/token_grant_kyc_transaction.py
  • examples/tokens/token_reject_transaction_fungible_token.py
  • examples/tokens/token_reject_transaction_nft.py
  • examples/tokens/token_revoke_kyc_transaction.py
  • examples/tokens/token_wipe_transaction.py
  • examples/transaction/transfer_transaction_fungible.py
  • examples/transaction/transfer_transaction_hbar.py
  • examples/transaction/transfer_transaction_nft.py
  • tests/integration/account_info_query_e2e_test.py
  • tests/integration/account_update_transaction_e2e_test.py
  • tests/integration/batch_transaction_e2e_test.py
  • tests/integration/query_e2e_test.py
  • tests/integration/revenue_generating_topics_e2e_test.py
  • tests/integration/token_grant_kyc_transaction_e2e_test.py
  • tests/integration/token_reject_transaction_e2e_test.py
  • tests/integration/token_revoke_kyc_transaction_e2e_test.py
  • tests/integration/token_update_transaction_e2e_test.py
  • tests/integration/transaction_record_query_e2e_test.py
  • tests/integration/utils.py
  • tests/unit/account_create_transaction_test.py
  • tests/unit/executable_test.py
🧰 Additional context used
📓 Path-based instructions (5)
examples/**/*

⚙️ CodeRabbit configuration file

examples/**/*: You are acting as a senior maintainer reviewing SDK examples. Your goal is to ensure examples work verbatim for users who copy-paste them.

Priority 1 - Correctness:

  • Verify transaction lifecycle chain (construction -> freeze_with -> sign -> execute).
  • Ensure freeze_with(client) is called BEFORE signing.
  • Validate that methods referenced actually exist in the hiero_sdk_python codebase.
  • Ensure response validation checks receipt.status against ResponseCode enums (e.g., ResponseCode.SUCCESS).

Priority 2 - Transaction Lifecycle:

  • Check method chaining logic.
  • Verify correct signing order (especially for multi-sig).
  • Ensure explicit .execute(client) calls.
  • Verify response property extraction (e.g., using .token_id, .account_id, .serial_numbers).
  • Ensure error handling uses ResponseCode(receipt.status).name for clarity.

Priority 3 - Naming & Clarity:

  • Enforce role-based naming: operator_id/_key, treasury_account_id/_key, receiver_id/_key.
  • Use _id suffix for AccountId and _key suffix for PrivateKey variables.
  • Validate negative examples explicitly check for failure codes (e.g., TOKEN_HAS_NO_PAUSE_KEY).
  • Ensure logical top-to-bottom flow without ambiguity.

Priority 4 - Consistency:

  • Verify standard patterns: def main(), if __name__ == "__main__":, load_dotenv().
  • IMPORT RULES:
    1. Accept both top-level imports (e.g., from hiero_sdk_python import PrivateKey) and fully qualified imports (e.g., from hiero_sdk_python.crypto.private_key import PrivateKey).
    2. STRICTLY validate that the import path actually exists in the project structure. Compare against other files in /examples or your knowledge of the SDK file tree.
    3. Flag hallucinations immediately (e.g., hiero_sdk_python.keys does not exist).
  • Check for try-except blocks with sys.exit(1) for critical failures.

Priority 5 - User Experience:

  • Ensure comments explain SDK usage patterns (for users,...

Files:

  • examples/schedule/schedule_create_transaction.py
  • examples/query/transaction_get_receipt_query.py
  • examples/consensus/topic_create_transaction_revenue_generating.py
  • examples/schedule/schedule_delete_transaction.py
  • examples/query/account_balance_query_2.py
  • examples/transaction/transfer_transaction_hbar.py
  • examples/account/account_create_transaction.py
  • examples/tokens/token_create_transaction_freeze_key.py
  • examples/account/account_allowance_delete_transaction_hbar.py
  • examples/transaction/transfer_transaction_fungible.py
  • examples/query/account_info_query.py
  • examples/transaction/transfer_transaction_nft.py
  • examples/tokens/token_dissociate_transaction.py
  • examples/account/account_update_transaction.py
  • examples/tokens/token_revoke_kyc_transaction.py
  • examples/tokens/token_grant_kyc_transaction.py
  • examples/tokens/token_reject_transaction_nft.py
  • examples/tokens/token_create_transaction_kyc_key.py
  • examples/account/account_allowance_approve_transaction_hbar.py
  • examples/tokens/token_associate_transaction.py
  • examples/tokens/token_create_transaction_max_automatic_token_associations_0.py
  • examples/tokens/token_airdrop_claim_auto.py
  • examples/tokens/account_allowance_approve_transaction.py
  • examples/logger/logging_example.py
  • examples/schedule/schedule_sign_transaction.py
  • examples/tokens/token_wipe_transaction.py
  • examples/tokens/token_airdrop_transaction_cancel.py
  • examples/tokens/token_reject_transaction_fungible_token.py
  • examples/query/transaction_record_query.py
  • examples/tokens/token_create_transaction_pause_key.py
  • examples/tokens/token_airdrop_claim_signature_required.py
  • examples/tokens/token_airdrop_transaction.py
  • examples/account/account_allowance_delete_transaction_nft.py
  • examples/tokens/token_create_transaction_wipe_key.py
  • examples/account/account_delete_transaction.py
  • examples/schedule/schedule_info_query.py
  • examples/account/account_allowance_approve_transaction_nft.py
  • examples/account/account_records_query.py
tests/unit/**/*

⚙️ CodeRabbit configuration file

tests/unit/**/*: You are acting as a senior maintainer reviewing unit tests for the hiero-sdk-python project. Your goal is to ensure tests are extensive, deterministic, and protect against breaking changes.

CRITICAL PRINCIPLES - Tests Must Fail Loudly & Deterministically:

  • Tests must provide useful error messages when they fail for future debugging.
  • No print() statements - use assertions with descriptive messages.
  • No timing-dependent or unseeded random assertions.
  • No network calls or external dependencies (unit tests are isolated).
  • No unjustified TODOs or skipped tests without tracking issues.

PRIORITY 1 - Protect Against Breaking Changes:

  • Assert public attributes exist (e.g., assert hasattr(obj, 'account_id')).
  • Assert return types where relevant (e.g., assert isinstance(result, AccountId)).
  • Assert fluent setters return self (e.g., assert tx.set_memo("test") is tx).
  • Assert backward-compatible defaults are maintained.
  • If a breaking change is introduced, tests must assert deprecation behavior and test old behavior until removal.

PRIORITY 2 - Constructor & Setter Behavior:

  • Test constructor behavior with valid inputs, edge cases, and invalid inputs.
  • Test setter behavior including method chaining (fluent interface).
  • Verify that setters validate input and raise appropriate exceptions.
  • Test that getters return expected values after construction/setting.

PRIORITY 3 - Comprehensive Coverage:

  • Unit tests should be extensive - test even if we don't expect users to use it currently.
  • Cover happy paths AND unhappy paths/edge cases.
  • Test boundary conditions, null/None values, empty collections, etc.
  • Avoid brittle ordering assertions unless order is part of the contract.

PRIORITY 4 - No Mocks for Non-Existent Modules:

  • All imports must reference actual SDK modules - no hallucinated paths.
  • Validate import paths against the actual src/hiero_sdk_python structure.
  • Mocks should only be used for external de...

Files:

  • tests/unit/executable_test.py
  • tests/unit/account_create_transaction_test.py
tests/integration/**/*

⚙️ CodeRabbit configuration file

tests/integration/**/*: You are acting as a senior maintainer reviewing integration tests for the hiero-sdk-python project. Your goal is to ensure end-to-end tests validate real network behavior safely and deterministically.

CRITICAL PRINCIPLES - Safety & Diagnosability:

  • Prioritize safety: No implicit or default mainnet usage.
  • Secrets and credentials must be injected safely (env vars, not hardcoded).
  • Test failures must be diagnosable with clear error messages.
  • Tests must assert observable network behavior, not just SUCCESS.
  • Failure-path tests must assert specific ResponseCode values (e.g., TOKEN_HAS_NO_PAUSE_KEY).

PRIORITY 1 - End-to-End Behavior:

  • Tests should be end-to-end: construct → freeze → sign → execute → verify.
  • Validate resulting balances, ownership, and state changes (not just transaction success).
  • Assert transaction receipts contain expected data (IDs, serial numbers, etc.).
  • Verify network state after operations (e.g., account balance changed, token transferred).

PRIORITY 2 - Test Structure & Maintainability:

  • One major behavior per test (clear focus).
  • Tests should be readable: clear names, brief docstrings, key inline comments.
  • Minimal abstraction layers - prefer clarity over DRY.
  • Is the file too monolithic? Flag if tests should be split into smaller modules.
  • Are helper functions good candidates for pytest fixtures or shared utilities?

PRIORITY 3 - Isolation & Cleanup:

  • Local account creation over operator reuse (avoid state pollution).
  • Are accounts, tokens, and allowances properly cleaned up to avoid state leakage?
  • Recommend teardown strategies or fixture scoping improvements.
  • Tests should not depend on execution order (avoid brittle assumptions).

PRIORITY 4 - Assertions & Coverage:

  • Do tests validate only success/failure, or also assert resulting state?
  • Suggest additional assertions that would strengthen correctness (balances, allowances, ownership).
  • Cover happy paths AND ...

Files:

  • tests/integration/token_grant_kyc_transaction_e2e_test.py
  • tests/integration/revenue_generating_topics_e2e_test.py
  • tests/integration/utils.py
  • tests/integration/token_reject_transaction_e2e_test.py
  • tests/integration/transaction_record_query_e2e_test.py
  • tests/integration/batch_transaction_e2e_test.py
  • tests/integration/token_update_transaction_e2e_test.py
  • tests/integration/account_info_query_e2e_test.py
  • tests/integration/account_update_transaction_e2e_test.py
  • tests/integration/token_revoke_kyc_transaction_e2e_test.py
  • tests/integration/query_e2e_test.py
docs/**

⚙️ CodeRabbit configuration file

docs/**: You are reviewing documentation for the Hiero Python SDK. These pages serve both SDK users and SDK developers.

Priority 1 - Correctness (code, commands, links)

  1. Verify code snippets conceptually run and match the current SDK API.
  2. Check shell commands and workflow steps against actual project tooling.
  3. Validate URLs and cross-references; flag broken or misleading links.

Priority 2 - Clarity and completeness

  1. Ensure each page states its purpose and expected outcome early.
  2. Prefer concrete, step-wise explanations over vague descriptions.
  3. Highlight missing prerequisites that would block a reader.
  4. For larger gaps, suggest filing a follow-up issue instead of blocking.

Priority 3 - Consistency and navigation

  1. Encourage consistent terminology with the SDK and examples.
  2. Check headings form a logical reading path.
  3. Confirm each page makes clear which audience it serves.

PHILOSOPHY

  • Treat docs as work-in-progress: optimize for correctness and clarity over perfection.
  • Keep feedback concise, action-oriented, and focused on reader success.
  • Do not request large-scale restructures unless current structure blocks understanding.

AVOID

  • Avoid lint-style feedback on Markdown formatting or minor wording.
  • Avoid proposing new conventions without clear benefit.
  • Avoid turning every high-level gap into a blocker.

Files:

  • docs/sdk_users/running_examples.md
docs/sdk_users/**

⚙️ CodeRabbit configuration file

docs/sdk_users/**: These documents are for SDK users who want to USE the Hiero Python SDK quickly and correctly.

Priority 1 - High-level guidance

  1. Ensure explanations are conceptual and point to /examples for runnable code.
  2. Check that required environment variables and network choices are clearly stated.

Priority 2 - No hidden assumptions

  1. Assume zero prior knowledge of this SDK and minimal Hedera background.
  2. Avoid requiring knowledge of repository layout or contribution workflow.

PHILOSOPHY

  • Keep explanations high-level and conceptual; defer runnable examples to /examples.
  • Focus on what users need to know before diving into code examples.

Files:

  • docs/sdk_users/running_examples.md
🧬 Code graph analysis (51)
examples/schedule/schedule_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/query/transaction_get_receipt_query.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/consensus/topic_create_transaction_revenue_generating.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/schedule/schedule_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/query/account_balance_query_2.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/transaction/transfer_transaction_hbar.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/unit/executable_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (2)
  • PrivateKey (14-471)
  • public_key (305-309)
examples/account/account_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/token_grant_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/revenue_generating_topics_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_create_transaction_freeze_key.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/account/account_allowance_delete_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/transaction/transfer_transaction_fungible.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/query/account_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/utils.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/transaction/transfer_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_dissociate_transaction.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/account/account_update_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_revoke_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/token_reject_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (2)
  • set_key_without_alias (94-107)
  • AccountCreateTransaction (27-380)
examples/tokens/token_grant_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/transaction_record_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/unit/account_create_transaction_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (4)
  • set_key_without_alias (94-107)
  • set_key_with_alias (109-135)
  • AccountCreateTransaction (27-380)
  • set_alias (220-244)
tests/integration/batch_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (2)
  • set_key_without_alias (94-107)
  • AccountCreateTransaction (27-380)
examples/tokens/token_reject_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_create_transaction_kyc_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_allowance_approve_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_associate_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/token_update_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_create_transaction_max_automatic_token_associations_0.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_airdrop_claim_auto.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/account_info_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/account_allowance_approve_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/logger/logging_example.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/schedule/schedule_sign_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_wipe_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_airdrop_transaction_cancel.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_reject_transaction_fungible_token.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/query/transaction_record_query.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_create_transaction_pause_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_airdrop_claim_signature_required.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_airdrop_transaction.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/account/account_allowance_delete_transaction_nft.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_create_transaction_wipe_key.py (3)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/unit/conftest.py (1)
  • private_key (54-56)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/account/account_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/schedule/schedule_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/account_update_transaction_e2e_test.py (3)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/utils.py (1)
  • env (23-27)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/integration/token_revoke_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_allowance_approve_transaction_nft.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/account/account_records_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (56)
tests/integration/revenue_generating_topics_e2e_test.py (2)

529-539: LGTM: Correct API migration for fee-exempt account creation.

The migration from set_key() to set_key_without_alias() is correct. The method appropriately creates an account with the fee-exempt key without establishing an alias, which aligns with the test's intent to verify fee exemption behavior.


592-602: LGTM: Consistent API migration.

The migration matches the pattern established at line 531 and is correct for this fee-exempt token scenario.

examples/tokens/token_wipe_transaction.py (1)

53-58: LGTM! Correct migration to non-deprecated method.

The replacement of set_key() with set_key_without_alias() is correct and aligns with the SDK's current API. The transaction lifecycle is properly constructed (build → freeze → execute), and the method accepts the public key as expected.

examples/schedule/schedule_delete_transaction.py (1)

51-70: LGTM!

The migration from set_key() to set_key_without_alias() is correct. The transaction lifecycle follows the proper pattern: construct → freeze_with(client)sign()execute(client), with proper receipt status validation using ResponseCode.SUCCESS.

tests/integration/utils.py (1)

54-67: LGTM!

The set_key_without_alias() migration is correct. The create_account helper appropriately validates receipt status and raises a clear AssertionError on failure, which is suitable for test utilities.

tests/integration/transaction_record_query_e2e_test.py (1)

23-29: LGTM!

The set_key_without_alias() migration is correct with proper receipt status assertion.

examples/query/account_balance_query_2.py (1)

57-72: LGTM!

The set_key_without_alias() migration is correct. Receipt validation against ResponseCode.SUCCESS is present with appropriate sys.exit(1) on failure.

CHANGELOG.md (1)

137-138: LGTM!

Changelog entry accurately documents the deprecation migration and follows the established format.

examples/schedule/schedule_create_transaction.py (1)

48-48: LGTM! Correct API migration.

The change from set_key() to set_key_without_alias() correctly updates to the non-deprecated API. The transaction lifecycle (freeze_with → sign → execute) is properly maintained.

examples/query/transaction_get_receipt_query.py (1)

52-52: LGTM! Correct API migration.

The change to set_key_without_alias() properly updates the deprecated API call. The complete transaction lifecycle on line 55 (freeze_with → sign → execute) is correct.

examples/transaction/transfer_transaction_fungible.py (1)

59-59: LGTM! Correct API migration.

The replacement of set_key() with set_key_without_alias() is correct. The transaction lifecycle on line 62 properly chains freeze_with → sign → execute.

examples/account/account_records_query.py (1)

50-50: LGTM! Correct API migration.

The change to set_key_without_alias() properly replaces the deprecated method. The transaction lifecycle correctly includes freeze_with(client) before execute(client).

examples/tokens/token_revoke_kyc_transaction.py (1)

111-111: LGTM!

The migration from set_key() to set_key_without_alias() is correct. The method properly accepts a PublicKey, and the transaction lifecycle (freeze → execute) follows SDK best practices.

examples/tokens/token_airdrop_transaction_cancel.py (1)

58-58: LGTM!

The API migration is correct, and the transaction lifecycle properly chains freeze_with(client).sign(operator_key).execute(client) as expected.

examples/tokens/token_create_transaction_pause_key.py (1)

197-197: LGTM!

The migration to set_key_without_alias() is correct. Transaction lifecycle follows the proper sequence: freeze → sign → execute.

examples/schedule/schedule_sign_transaction.py (1)

59-59: LGTM!

The API migration is correct, and the transaction properly follows the freeze → sign → execute lifecycle as required by the SDK.

examples/tokens/token_reject_transaction_nft.py (1)

59-59: LGTM on the API migration!

The migration from set_key() to set_key_without_alias() is correct. The method properly accepts a PublicKey type.

examples/schedule/schedule_info_query.py (1)

52-52: LGTM: API migration correctly applied.

The replacement of set_key() with set_key_without_alias() is correct and maintains the transaction lifecycle (construct → freeze → sign → execute). The change aligns with the SDK's migration away from the deprecated method.

examples/tokens/token_airdrop_claim_signature_required.py (1)

101-101: LGTM: API migration correctly applied.

The replacement of set_key() with set_key_without_alias() is correct. Transaction lifecycle remains intact (freeze → sign → execute), and error handling properly validates ResponseCode.SUCCESS.

examples/account/account_create_transaction.py (1)

78-78: LGTM: API migration correctly applied.

The replacement of set_key() with set_key_without_alias() is correct and preserves the transaction lifecycle. Variable naming (new_account_public_key, operator_key) and error handling follow best practices.

examples/account/account_update_transaction.py (1)

47-47: LGTM: API migration correctly applied.

The replacement of set_key() with set_key_without_alias() is correct. Transaction lifecycle and error handling (including sys.exit(1) on failure) follow SDK example conventions.

tests/integration/token_grant_kyc_transaction_e2e_test.py (1)

22-22: LGTM: API migration correctly applied across all three tests.

All three replacements of set_key() with set_key_without_alias() are correct. Transaction lifecycles remain intact, and the tests properly validate end-to-end behavior including:

  • Successful account creation (ResponseCode.SUCCESS)
  • Negative paths with specific error codes (TOKEN_HAS_NO_KYC_KEY, TOKEN_NOT_ASSOCIATED_TO_ACCOUNT)

The changes maintain test clarity and correctness.

Also applies to: 65-65, 119-119

tests/integration/token_update_transaction_e2e_test.py (2)

113-113: LGTM: API migration is correct.

The migration from set_key() to set_key_without_alias() is consistent with the PR objectives and maintains the same account creation behavior.


177-177: LGTM: API migration is correct.

The migration from set_key() to set_key_without_alias() is consistent with the PR objectives and maintains the same account creation behavior.

examples/account/account_allowance_approve_transaction_hbar.py (1)

70-70: LGTM: Correct API migration.

The change to set_key_without_alias() aligns with the deprecated API migration and follows the proper transaction lifecycle. The example remains functional and clear for users.

examples/tokens/token_create_transaction_kyc_key.py (1)

94-94: LGTM: Correct API migration.

The change to set_key_without_alias() aligns with the deprecated API migration and maintains the proper transaction lifecycle (freeze_with → sign → execute).

examples/tokens/token_grant_kyc_transaction.py (1)

108-108: LGTM: Correct API migration.

The change to set_key_without_alias() aligns with the deprecated API migration and follows the proper transaction lifecycle pattern.

examples/transaction/transfer_transaction_nft.py (1)

59-59: LGTM: Correct API migration.

The change to set_key_without_alias() aligns with the deprecated API migration and maintains the proper transaction lifecycle for account creation.

examples/tokens/token_create_transaction_max_automatic_token_associations_0.py (1)

95-95: LGTM! Correct API migration.

The replacement of deprecated set_key() with set_key_without_alias() is correct. The transaction lifecycle is properly maintained (construct → freeze → sign → execute), and the method receives the correct argument type (public key).

tests/integration/batch_transaction_e2e_test.py (2)

21-21: LGTM! Helper function correctly updated.

The create_account_tx helper properly uses set_key_without_alias() for account creation. This change is consistently applied across all test usages of this helper.


165-165: LGTM! All test account creations correctly migrated.

All direct usages of account creation in tests have been properly updated to use set_key_without_alias(). The test structure and assertions remain intact, validating end-to-end batch transaction behavior.

Also applies to: 266-266, 282-282, 289-289, 297-297

examples/tokens/token_associate_transaction.py (1)

78-78: LGTM! Correct migration in token association example.

The account creation properly uses set_key_without_alias() with the new account's public key. Transaction lifecycle is correct (freeze_with before signing), and error handling validates the receipt status properly.

examples/account/account_allowance_delete_transaction_nft.py (1)

73-73: LGTM! Account creation correctly updated.

The create_account helper properly uses set_key_without_alias() for account creation. The change aligns with the API migration and maintains the correct transaction execution pattern.

examples/tokens/token_airdrop_claim_auto.py (1)

92-92: LGTM! Receiver account creation correctly migrated.

The create_receiver function properly uses set_key_without_alias() for account creation. The transaction lifecycle is correct (freeze_with → sign → execute), and error handling validates the receipt status with clear messaging.

examples/tokens/token_create_transaction_freeze_key.py (1)

183-183: LGTM! Correct migration to set_key_without_alias().

The change correctly replaces the deprecated set_key() with set_key_without_alias() and properly passes the public key. The transaction lifecycle (construction → freeze_with → sign → execute) is correctly followed.

docs/sdk_users/running_examples.md (1)

123-123: LGTM! Documentation correctly updated.

The documentation accurately reflects the API change from set_key() to set_key_without_alias() and demonstrates the correct transaction lifecycle pattern for users to follow.

examples/transaction/transfer_transaction_hbar.py (1)

56-56: LGTM! Correct migration to set_key_without_alias().

The change correctly replaces the deprecated set_key() with set_key_without_alias() and properly passes the public key. The transaction lifecycle (construction → freeze_with → sign → execute) is correctly followed.

tests/integration/query_e2e_test.py (1)

25-25: LGTM! API migration applied consistently.

All five occurrences of set_key() have been correctly replaced with set_key_without_alias(). The tests remain structurally sound with proper end-to-end flows (account creation → operator setup → query execution → balance verification) and appropriate cleanup.

Also applies to: 75-75, 132-132, 171-171, 217-217

examples/account/account_allowance_approve_transaction_nft.py (1)

86-86: LGTM! Example correctly migrated to non-deprecated API.

The helper function correctly uses set_key_without_alias() with the public key derived from the generated private key. The example follows SDK patterns with appropriate transaction lifecycle and response validation.

tests/integration/token_revoke_kyc_transaction_e2e_test.py (1)

23-23: LGTM! Consistent API migration across all test cases.

All three test functions correctly use set_key_without_alias(). The tests maintain robust end-to-end validation covering both success scenarios and specific failure modes (TOKEN_HAS_NO_KYC_KEY, TOKEN_NOT_ASSOCIATED_TO_ACCOUNT) with appropriate ResponseCode assertions.

Also applies to: 75-75, 127-127

tests/integration/account_update_transaction_e2e_test.py (1)

28-28: LGTM! Five test functions correctly migrated.

The changed lines properly use set_key_without_alias() and the tests maintain their end-to-end validation structure with appropriate assertions.

Also applies to: 104-104, 142-142, 341-341, 351-351

tests/integration/token_reject_transaction_e2e_test.py (1)

116-116: LGTM! All builder-pattern usages correctly migrated.

The four occurrences using the builder pattern correctly use set_key_without_alias(). Note that other tests in this file use the constructor pattern AccountCreateTransaction(key=...) which directly sets the key parameter and doesn't involve the deprecated set_key() method, so those are already compliant.

Also applies to: 177-177, 883-883, 903-903

examples/tokens/token_airdrop_transaction.py (1)

59-59: LGTM - Correct migration to non-deprecated method.

The replacement of .set_key() with .set_key_without_alias() is correct and aligns with the PR's objective to migrate away from deprecated methods.

tests/unit/account_create_transaction_test.py (7)

45-45: LGTM - Correct migration to non-deprecated method.

The test now correctly uses .set_key_without_alias() instead of the deprecated .set_key().


70-70: LGTM - Correct migration to non-deprecated method.

The test now correctly uses .set_key_without_alias() for the scheduled transaction body test.


105-105: LGTM - Correct migration to non-deprecated method.

The test now correctly uses .set_key_without_alias() for the signing test.


170-170: LGTM - Correct migration to non-deprecated method.

The test now correctly uses .set_key_without_alias() for the integration test.


237-237: LGTM - Correct migration to non-deprecated method.

The test now correctly uses .set_key_without_alias() for the max automatic token associations test.


386-386: LGTM - Correct migration to non-deprecated method.

The test now correctly uses .set_key_without_alias() for the invalid alias string test.


394-394: LGTM - Correct migration to non-deprecated method.

The test now correctly uses .set_key_without_alias() for the invalid alias type test.

tests/integration/account_info_query_e2e_test.py (1)

31-31: LGTM - Correct migration to non-deprecated method.

The integration test now correctly uses .set_key_without_alias() instead of the deprecated .set_key().

examples/account/account_allowance_delete_transaction_hbar.py (1)

43-43: LGTM - Correct migration to non-deprecated method.

The example now correctly uses .set_key_without_alias() instead of the deprecated .set_key().

tests/unit/executable_test.py (1)

55-55: LGTM - Correct migration to non-deprecated method.

All usages of .set_key_without_alias() in this test file correctly replace the deprecated .set_key() method.

examples/account/account_delete_transaction.py (1)

27-27: LGTM!

Correct replacement of deprecated set_key() with set_key_without_alias(). The transaction lifecycle (freeze → sign → execute) and response validation are properly implemented.

examples/query/account_info_query.py (1)

57-57: LGTM!

Correct replacement of deprecated set_key() with set_key_without_alias(). The transaction lifecycle and response validation are properly implemented, following SDK best practices.

examples/tokens/token_reject_transaction_fungible_token.py (1)

57-57: LGTM! Correct usage of set_key_without_alias().

The migration from deprecated set_key() to set_key_without_alias() is correct. The method exists in the SDK (confirmed in account_create_transaction.py) and properly accepts the PublicKey type for account creation without alias.

@prishajaiswal75 prishajaiswal75 force-pushed the fix/deprecate-set-key-clean branch from c576538 to a74ddf6 Compare January 4, 2026 22:10
@prishajaiswal75
Copy link
Contributor Author

My last branch was polluted and created a cleaned up the branch to a single signed commit.
This PR only includes the deprecated set_key replacement. I dont understand then why is python bot failing?

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (15)
examples/account/account_records_query.py (1)

148-152: Missing .freeze_with(client) in transaction lifecycle.

The TransferTransaction should call .freeze_with(client) before .execute(client) to follow the standard transaction lifecycle pattern (construction → freeze_with → execute). This matches the pattern used in the AccountCreateTransaction earlier in the file (lines 48-55).

🔎 Proposed fix
 receipt = (
     TransferTransaction()
     .add_hbar_transfer(account_id, -Hbar(1).to_tinybars())
     .add_hbar_transfer(original_operator_id, Hbar(1).to_tinybars())
+    .freeze_with(client)
     .execute(client)
 )

Note: This is a pre-existing issue, not introduced by this PR, but should be fixed to ensure examples demonstrate correct SDK usage patterns.

examples/account/account_allowance_approve_transaction_nft.py (2)

50-50: Inconsistent import style - consider moving to top-level imports.

AccountCreateTransaction uses a fully qualified import while all other transaction types (TokenCreateTransaction, TokenMintTransaction, etc.) are imported from the top-level hiero_sdk_python package (lines 34-49). For examples that users copy-paste, consistent import patterns improve readability.

🔎 Suggested refactor to align import style

Move AccountCreateTransaction to the top-level import block:

 from hiero_sdk_python import (
     Client,
     AccountId,
     PrivateKey,
     Network,
     Hbar,
     ResponseCode,
+    AccountCreateTransaction,
     TokenCreateTransaction,
     TokenType,
     SupplyType,
     TokenMintTransaction,
     NftId,
     TokenAssociateTransaction,
     AccountAllowanceApproveTransaction,
     TransferTransaction,
 )
-from hiero_sdk_python.account.account_create_transaction import AccountCreateTransaction

84-90: Consider explicit freeze_with + sign for transaction lifecycle clarity.

This transaction executes directly without explicit freeze_with(client) and sign() calls, while other transactions in this file (e.g., create_nft_token, associate_token_with_account, approve_nft_allowance) follow the full lifecycle pattern. For SDK examples that users copy-paste, consistent and explicit patterns help reinforce best practices.

🔎 Suggested refactor for explicit transaction lifecycle
     tx = (
         AccountCreateTransaction()
         .set_key_without_alias(public_key)
         .set_initial_balance(Hbar(10))
         .set_account_memo(memo)
+        .freeze_with(client)
+    )
+    
+    receipt = tx.execute(client)
+
+    if receipt.status != ResponseCode.SUCCESS:
+        print(f"Account creation failed: {ResponseCode(receipt.status).name}")
-        .execute(client)
-    )
-
-    if tx.status != ResponseCode.SUCCESS:
-        print(f"Account creation failed: {ResponseCode(tx.status).name}")
         sys.exit(1)
 
-    account_id = tx.account_id
+    account_id = receipt.account_id
     print(f"Created new account ({memo}): {account_id}")
     return account_id, private_key

Note: This same pattern appears in mint_nft (line 131-136) and transfer_nft_using_allowance (line 192-196). Consider applying consistently across the file.

examples/account/account_allowance_delete_transaction_nft.py (2)

36-36: Optional: Import style inconsistency.

Line 36 uses a fully qualified import for AccountCreateTransaction, while lines 19-35 use top-level imports. Both styles are valid, but for consistency consider using the top-level import:

-from hiero_sdk_python.account.account_create_transaction import AccountCreateTransaction
+# Add to top-level imports above:
+# AccountCreateTransaction,

This is a minor style nitpick and not blocking.


71-77: Add freeze_with(client) to AccountCreateTransaction for proper transaction lifecycle.

The AccountCreateTransaction at lines 71-77 omits freeze_with(client), which violates the transaction lifecycle guideline (Priority 1: construction → freeze_with → sign → execute). Nearly all other AccountCreateTransaction examples across the codebase include this call, and the same guideline is consistently applied to other transactions in this file (lines 98-111, 155-162, 186-192, 222-228).

Recommended change
 tx = (
     AccountCreateTransaction()
     .set_key_without_alias(public_key)
     .set_initial_balance(Hbar(10))
     .set_account_memo(memo)
+    .freeze_with(client)
     .execute(client)
 )
examples/account/account_allowance_delete_transaction_hbar.py (1)

41-47: Transaction lifecycle deviates from standard example pattern.

This example omits .freeze_with(client) and .sign(account_private_key) before .execute(client), which differs from all other examples in this PR and the coding guidelines' expectation: "construction → freeze_with → sign → execute."

While this may work (the SDK might auto-freeze and use the operator's signature), it creates inconsistency for users copying examples. Consider aligning with the standard pattern:

 account_receipt = (
     AccountCreateTransaction()
     .set_key_without_alias(account_public_key)
     .set_initial_balance(Hbar(1))
     .set_account_memo("Account for hbar allowance")
+    .freeze_with(client)
+    .sign(account_private_key)
     .execute(client)
 )
examples/transaction/transfer_transaction_fungible.py (1)

52-69: Add explicit receipt status validation.

The create_account function lacks explicit validation of receipt.status against ResponseCode.SUCCESS. While the try-except block catches exceptions, it doesn't verify the transaction succeeded on the network. Other functions in this file (e.g., create_token, associate_token) validate status explicitly.

🔎 Proposed fix
     try:
         tx = (
             AccountCreateTransaction()
             .set_key_without_alias(recipient_key.public_key())
             .set_initial_balance(Hbar.from_tinybars(100_000_000))
         )
         receipt = tx.freeze_with(client).sign(operator_key).execute(client)
+        
+        if receipt.status != ResponseCode.SUCCESS:
+            print(f"❌ Account creation failed with status: {ResponseCode(receipt.status).name}")
+            sys.exit(1)
+            
         recipient_id = receipt.account_id
         print(f"✅ Success! Created a new recipient account with ID: {recipient_id}")
         return recipient_id, recipient_key

As per coding guidelines: Examples must validate receipt.status against ResponseCode enums (Priority 1 - Correctness).

tests/integration/revenue_generating_topics_e2e_test.py (2)

529-539: Missing freeze_with(client) in transaction lifecycle.

The AccountCreateTransaction calls .execute(env.client) without first calling .freeze_with(env.client). Integration tests must follow the explicit end-to-end pattern: construction → freeze_with → sign → execute.

🔎 Proposed fix
     receipt = (
         AccountCreateTransaction()
         .set_key_without_alias(fee_exempt_key1.public_key())
         .set_initial_balance(Hbar(1))
+        .freeze_with(env.client)
+        .sign(fee_exempt_key1)
         .execute(env.client)
     )

As per coding guidelines: Integration tests should be end-to-end: construct → freeze → sign → execute → verify (Priority 1 - End-to-End Behavior).


592-602: Missing freeze_with(client) in transaction lifecycle.

The AccountCreateTransaction calls .execute(env.client) without first calling .freeze_with(env.client). This is the same issue as in the previous test at lines 529-539.

🔎 Proposed fix
     receipt = (
         AccountCreateTransaction()
         .set_key_without_alias(fee_exempt_key1.public_key())
         .set_initial_balance(Hbar(1))
+        .freeze_with(env.client)
+        .sign(fee_exempt_key1)
         .execute(env.client)
     )

As per coding guidelines: Integration tests should be end-to-end: construct → freeze → sign → execute → verify (Priority 1 - End-to-End Behavior).

examples/tokens/token_revoke_kyc_transaction.py (1)

109-116: Add explicit signing for consistency with other examples.

While the transaction includes .freeze_with(client), it lacks explicit .sign(operator_key) before .execute(client). This is inconsistent with other examples in this PR:

  • examples/account/account_create_transaction.py (line 85): explicitly signs with operator_key
  • examples/transaction/transfer_transaction_fungible.py (line 62): explicitly signs with operator_key
🔎 Proposed fix
+    # Get the operator key from the client for signing
+    operator_key = client.operator_private_key
+
     # Create new account with initial balance of 1 HBAR
     transaction = (
         AccountCreateTransaction()
         .set_key_without_alias(new_account_public_key)
         .set_initial_balance(Hbar(1))
         .freeze_with(client)
+        .sign(operator_key)
     )
 
     receipt = transaction.execute(client)

As per coding guidelines: Verify correct signing order and ensure explicit .execute(client) calls follow standard patterns (Priority 2 - Transaction Lifecycle; Priority 4 - Consistency).

tests/integration/utils.py (1)

54-67: Consider adding explicit freeze_with() before execute() for clarity.

The transaction is executed without an explicit freeze_with(self.client) call (line 62). While the client may auto-freeze internally, integration tests should demonstrate the complete lifecycle (construct → freeze → sign → execute) for consistency with examples and to avoid confusion.

🔎 Suggested improvement
 def create_account(self, initial_hbar: float = 1.0) -> Account:
     """Create a new account funded with `initial_hbar` HBAR, defaulting to 1."""
     key = PrivateKey.generate()
     tx = (
         AccountCreateTransaction()
             .set_key_without_alias(key.public_key())
             .set_initial_balance(Hbar(initial_hbar))
+            .freeze_with(self.client)
     )
     receipt = tx.execute(self.client)
examples/tokens/token_grant_kyc_transaction.py (1)

106-113: Consider adding explicit .sign() call before execution for clarity.

The transaction is frozen (line 110) and executed (line 113) without an explicit sign step. While the client with an operator set may auto-sign, examples should demonstrate the complete lifecycle (freeze → sign → execute) for clarity and consistency with other examples in the codebase.

🔎 Suggested improvement

For account creation, the operator should sign the transaction:

     # Create new account with initial balance of 1 HBAR
     transaction = (
         AccountCreateTransaction()
         .set_key_without_alias(new_account_public_key)
         .set_initial_balance(Hbar(1))
         .freeze_with(client)
     )
 
-    receipt = transaction.execute(client)
+    # The operator (payer) must sign account creation transactions
+    receipt = transaction.sign(client.operator_private_key).execute(client)

Note: You'll need to ensure client.operator_private_key is accessible, or pass operator_key from setup_client() as a parameter to this function.

examples/tokens/account_allowance_approve_transaction.py (1)

51-57: Missing freeze_with(client) breaks transaction lifecycle.

The transaction is missing freeze_with(client) before execute(client). Per SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute.

🔎 Proposed fix
 account_receipt = (
     AccountCreateTransaction()
     .set_key_without_alias(account_public_key)
     .set_initial_balance(Hbar(1))
     .set_account_memo("Account for token allowance")
+    .freeze_with(client)
     .execute(client)
 )
examples/account/account_allowance_approve_transaction_hbar.py (1)

83-83: Optional: Consider simplifying variable name.

The variable name account_account_id is redundant. Consider renaming to account_id for clarity, consistent with the _id suffix convention used elsewhere in examples.

tests/integration/account_update_transaction_e2e_test.py (1)

186-186: Replace all remaining deprecated set_key() calls with set_key_without_alias().

The set_key() method in AccountCreateTransaction is deprecated (see SDK source). Lines 186, 238, 276, 305, and 383 still use the deprecated method while lines 28, 104, 142, 341, and 351 have already been migrated to set_key_without_alias(). Complete the migration consistently across this file.

♻️ Duplicate comments (6)
examples/tokens/token_dissociate_transaction.py (1)

57-57: Remove or clarify the inline comment.

This comment # <-- THE FIX: Call as a method was already flagged in a previous review as misleading. The actual change is replacing the deprecated set_key() with set_key_without_alias(), not about "calling as a method" (it was always a method call).

For user-facing examples, either remove this contributor-focused comment or replace it with something that explains the SDK usage pattern:

.set_key_without_alias(recipient_key.public_key())  # Associates key without creating an alias
examples/tokens/token_reject_transaction_fungible_token.py (1)

55-60: API migration correct, but missing freeze_with(client) (already flagged).

The replacement of set_key() with set_key_without_alias() on line 57 is correct. However, this transaction is missing freeze_with(client) before execute(client) on line 59, making it inconsistent with all other transactions in this file (see lines 91, 117, 140, 204). This violates the required transaction lifecycle pattern.

As noted in the previous review comment, add freeze_with(client) before execute(client):

 receipt = (
     AccountCreateTransaction()
     .set_key_without_alias(new_account_public_key)
     .set_initial_balance(Hbar(1))
+    .freeze_with(client)
     .execute(client)
 )
examples/tokens/token_reject_transaction_nft.py (1)

57-62: Missing freeze_with(client) in transaction lifecycle.

The AccountCreateTransaction calls .execute(client) without first calling .freeze_with(client). This violates the SDK transaction lifecycle pattern (construction → freeze_with → sign → execute).

🔎 Proposed fix
     receipt = (
         AccountCreateTransaction()
         .set_key_without_alias(new_account_public_key)
         .set_initial_balance(Hbar(1))
+        .freeze_with(client)
         .execute(client)
     )

As per coding guidelines: Verify transaction lifecycle chain (construction → freeze_with → sign → execute) and ensure freeze_with(client) is called BEFORE signing (Priority 1 - Correctness).

examples/tokens/token_create_transaction_wipe_key.py (1)

76-81: Missing freeze_with(client) breaks transaction lifecycle.

The transaction is missing freeze_with(client) before execute(client). Per SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute.

🔎 Proposed fix
 tx = (
     AccountCreateTransaction()
     .set_key_without_alias(private_key.public_key())
     .set_initial_balance(Hbar(2))
+    .freeze_with(client)
 )
 receipt = tx.execute(client)
examples/consensus/topic_create_transaction_revenue_generating.py (1)

66-71: Missing freeze_with(client) breaks transaction lifecycle.

The transaction is missing freeze_with(client) before execute(client). Per SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute.

🔎 Proposed fix
 receipt = (
     AccountCreateTransaction()
     .set_key_without_alias(account_public_key)
     .set_initial_balance(initial_balance)
+    .freeze_with(client)
     .execute(client)
 )
tests/unit/account_create_transaction_test.py (1)

188-193: Fix syntax error - mismatched parentheses.

Line 192 has an extra closing parenthesis that will cause a syntax error. This was flagged in a previous review and needs to be corrected.

🔎 Proposed fix
     account_tx = (
         AccountCreateTransaction()
         .set_key_without_alias(new_public_key)
         .set_initial_balance(100000000)
-        .set_account_memo("Test account"))
+        .set_account_memo("Test account")
     )
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c576538 and a74ddf6.

📒 Files selected for processing (53)
  • CHANGELOG.md
  • docs/sdk_users/running_examples.md
  • examples/account/account_allowance_approve_transaction_hbar.py
  • examples/account/account_allowance_approve_transaction_nft.py
  • examples/account/account_allowance_delete_transaction_hbar.py
  • examples/account/account_allowance_delete_transaction_nft.py
  • examples/account/account_create_transaction.py
  • examples/account/account_delete_transaction.py
  • examples/account/account_records_query.py
  • examples/account/account_update_transaction.py
  • examples/consensus/topic_create_transaction_revenue_generating.py
  • examples/logger/logging_example.py
  • examples/query/account_balance_query_2.py
  • examples/query/account_info_query.py
  • examples/query/transaction_get_receipt_query.py
  • examples/query/transaction_record_query.py
  • examples/schedule/schedule_create_transaction.py
  • examples/schedule/schedule_delete_transaction.py
  • examples/schedule/schedule_info_query.py
  • examples/schedule/schedule_sign_transaction.py
  • examples/tokens/account_allowance_approve_transaction.py
  • examples/tokens/token_airdrop_claim_auto.py
  • examples/tokens/token_airdrop_claim_signature_required.py
  • examples/tokens/token_airdrop_transaction.py
  • examples/tokens/token_airdrop_transaction_cancel.py
  • examples/tokens/token_associate_transaction.py
  • examples/tokens/token_create_transaction_freeze_key.py
  • examples/tokens/token_create_transaction_kyc_key.py
  • examples/tokens/token_create_transaction_max_automatic_token_associations_0.py
  • examples/tokens/token_create_transaction_pause_key.py
  • examples/tokens/token_create_transaction_wipe_key.py
  • examples/tokens/token_dissociate_transaction.py
  • examples/tokens/token_grant_kyc_transaction.py
  • examples/tokens/token_reject_transaction_fungible_token.py
  • examples/tokens/token_reject_transaction_nft.py
  • examples/tokens/token_revoke_kyc_transaction.py
  • examples/tokens/token_wipe_transaction.py
  • examples/transaction/transfer_transaction_fungible.py
  • examples/transaction/transfer_transaction_hbar.py
  • examples/transaction/transfer_transaction_nft.py
  • tests/integration/account_info_query_e2e_test.py
  • tests/integration/account_update_transaction_e2e_test.py
  • tests/integration/batch_transaction_e2e_test.py
  • tests/integration/query_e2e_test.py
  • tests/integration/revenue_generating_topics_e2e_test.py
  • tests/integration/token_grant_kyc_transaction_e2e_test.py
  • tests/integration/token_reject_transaction_e2e_test.py
  • tests/integration/token_revoke_kyc_transaction_e2e_test.py
  • tests/integration/token_update_transaction_e2e_test.py
  • tests/integration/transaction_record_query_e2e_test.py
  • tests/integration/utils.py
  • tests/unit/account_create_transaction_test.py
  • tests/unit/executable_test.py
🧰 Additional context used
📓 Path-based instructions (5)
examples/**/*

⚙️ CodeRabbit configuration file

examples/**/*: You are acting as a senior maintainer reviewing SDK examples. Your goal is to ensure examples work verbatim for users who copy-paste them.

Priority 1 - Correctness:

  • Verify transaction lifecycle chain (construction -> freeze_with -> sign -> execute).
  • Ensure freeze_with(client) is called BEFORE signing.
  • Validate that methods referenced actually exist in the hiero_sdk_python codebase.
  • Ensure response validation checks receipt.status against ResponseCode enums (e.g., ResponseCode.SUCCESS).

Priority 2 - Transaction Lifecycle:

  • Check method chaining logic.
  • Verify correct signing order (especially for multi-sig).
  • Ensure explicit .execute(client) calls.
  • Verify response property extraction (e.g., using .token_id, .account_id, .serial_numbers).
  • Ensure error handling uses ResponseCode(receipt.status).name for clarity.

Priority 3 - Naming & Clarity:

  • Enforce role-based naming: operator_id/_key, treasury_account_id/_key, receiver_id/_key.
  • Use _id suffix for AccountId and _key suffix for PrivateKey variables.
  • Validate negative examples explicitly check for failure codes (e.g., TOKEN_HAS_NO_PAUSE_KEY).
  • Ensure logical top-to-bottom flow without ambiguity.

Priority 4 - Consistency:

  • Verify standard patterns: def main(), if __name__ == "__main__":, load_dotenv().
  • IMPORT RULES:
    1. Accept both top-level imports (e.g., from hiero_sdk_python import PrivateKey) and fully qualified imports (e.g., from hiero_sdk_python.crypto.private_key import PrivateKey).
    2. STRICTLY validate that the import path actually exists in the project structure. Compare against other files in /examples or your knowledge of the SDK file tree.
    3. Flag hallucinations immediately (e.g., hiero_sdk_python.keys does not exist).
  • Check for try-except blocks with sys.exit(1) for critical failures.

Priority 5 - User Experience:

  • Ensure comments explain SDK usage patterns (for users,...

Files:

  • examples/account/account_allowance_approve_transaction_nft.py
  • examples/schedule/schedule_create_transaction.py
  • examples/tokens/token_airdrop_claim_auto.py
  • examples/account/account_update_transaction.py
  • examples/tokens/token_airdrop_transaction_cancel.py
  • examples/account/account_allowance_delete_transaction_hbar.py
  • examples/schedule/schedule_info_query.py
  • examples/tokens/token_wipe_transaction.py
  • examples/transaction/transfer_transaction_fungible.py
  • examples/account/account_records_query.py
  • examples/schedule/schedule_delete_transaction.py
  • examples/tokens/token_create_transaction_wipe_key.py
  • examples/tokens/token_create_transaction_max_automatic_token_associations_0.py
  • examples/tokens/token_associate_transaction.py
  • examples/query/transaction_record_query.py
  • examples/account/account_allowance_delete_transaction_nft.py
  • examples/tokens/token_dissociate_transaction.py
  • examples/account/account_allowance_approve_transaction_hbar.py
  • examples/query/account_balance_query_2.py
  • examples/tokens/token_reject_transaction_fungible_token.py
  • examples/tokens/token_create_transaction_freeze_key.py
  • examples/tokens/account_allowance_approve_transaction.py
  • examples/consensus/topic_create_transaction_revenue_generating.py
  • examples/logger/logging_example.py
  • examples/tokens/token_airdrop_transaction.py
  • examples/transaction/transfer_transaction_hbar.py
  • examples/tokens/token_create_transaction_pause_key.py
  • examples/tokens/token_revoke_kyc_transaction.py
  • examples/tokens/token_create_transaction_kyc_key.py
  • examples/account/account_create_transaction.py
  • examples/tokens/token_airdrop_claim_signature_required.py
  • examples/schedule/schedule_sign_transaction.py
  • examples/transaction/transfer_transaction_nft.py
  • examples/account/account_delete_transaction.py
  • examples/query/account_info_query.py
  • examples/tokens/token_grant_kyc_transaction.py
  • examples/query/transaction_get_receipt_query.py
  • examples/tokens/token_reject_transaction_nft.py
tests/integration/**/*

⚙️ CodeRabbit configuration file

tests/integration/**/*: You are acting as a senior maintainer reviewing integration tests for the hiero-sdk-python project. Your goal is to ensure end-to-end tests validate real network behavior safely and deterministically.

CRITICAL PRINCIPLES - Safety & Diagnosability:

  • Prioritize safety: No implicit or default mainnet usage.
  • Secrets and credentials must be injected safely (env vars, not hardcoded).
  • Test failures must be diagnosable with clear error messages.
  • Tests must assert observable network behavior, not just SUCCESS.
  • Failure-path tests must assert specific ResponseCode values (e.g., TOKEN_HAS_NO_PAUSE_KEY).

PRIORITY 1 - End-to-End Behavior:

  • Tests should be end-to-end: construct → freeze → sign → execute → verify.
  • Validate resulting balances, ownership, and state changes (not just transaction success).
  • Assert transaction receipts contain expected data (IDs, serial numbers, etc.).
  • Verify network state after operations (e.g., account balance changed, token transferred).

PRIORITY 2 - Test Structure & Maintainability:

  • One major behavior per test (clear focus).
  • Tests should be readable: clear names, brief docstrings, key inline comments.
  • Minimal abstraction layers - prefer clarity over DRY.
  • Is the file too monolithic? Flag if tests should be split into smaller modules.
  • Are helper functions good candidates for pytest fixtures or shared utilities?

PRIORITY 3 - Isolation & Cleanup:

  • Local account creation over operator reuse (avoid state pollution).
  • Are accounts, tokens, and allowances properly cleaned up to avoid state leakage?
  • Recommend teardown strategies or fixture scoping improvements.
  • Tests should not depend on execution order (avoid brittle assumptions).

PRIORITY 4 - Assertions & Coverage:

  • Do tests validate only success/failure, or also assert resulting state?
  • Suggest additional assertions that would strengthen correctness (balances, allowances, ownership).
  • Cover happy paths AND ...

Files:

  • tests/integration/token_grant_kyc_transaction_e2e_test.py
  • tests/integration/revenue_generating_topics_e2e_test.py
  • tests/integration/query_e2e_test.py
  • tests/integration/batch_transaction_e2e_test.py
  • tests/integration/token_update_transaction_e2e_test.py
  • tests/integration/transaction_record_query_e2e_test.py
  • tests/integration/account_update_transaction_e2e_test.py
  • tests/integration/token_revoke_kyc_transaction_e2e_test.py
  • tests/integration/token_reject_transaction_e2e_test.py
  • tests/integration/utils.py
  • tests/integration/account_info_query_e2e_test.py
docs/**

⚙️ CodeRabbit configuration file

docs/**: You are reviewing documentation for the Hiero Python SDK. These pages serve both SDK users and SDK developers.

Priority 1 - Correctness (code, commands, links)

  1. Verify code snippets conceptually run and match the current SDK API.
  2. Check shell commands and workflow steps against actual project tooling.
  3. Validate URLs and cross-references; flag broken or misleading links.

Priority 2 - Clarity and completeness

  1. Ensure each page states its purpose and expected outcome early.
  2. Prefer concrete, step-wise explanations over vague descriptions.
  3. Highlight missing prerequisites that would block a reader.
  4. For larger gaps, suggest filing a follow-up issue instead of blocking.

Priority 3 - Consistency and navigation

  1. Encourage consistent terminology with the SDK and examples.
  2. Check headings form a logical reading path.
  3. Confirm each page makes clear which audience it serves.

PHILOSOPHY

  • Treat docs as work-in-progress: optimize for correctness and clarity over perfection.
  • Keep feedback concise, action-oriented, and focused on reader success.
  • Do not request large-scale restructures unless current structure blocks understanding.

AVOID

  • Avoid lint-style feedback on Markdown formatting or minor wording.
  • Avoid proposing new conventions without clear benefit.
  • Avoid turning every high-level gap into a blocker.

Files:

  • docs/sdk_users/running_examples.md
docs/sdk_users/**

⚙️ CodeRabbit configuration file

docs/sdk_users/**: These documents are for SDK users who want to USE the Hiero Python SDK quickly and correctly.

Priority 1 - High-level guidance

  1. Ensure explanations are conceptual and point to /examples for runnable code.
  2. Check that required environment variables and network choices are clearly stated.

Priority 2 - No hidden assumptions

  1. Assume zero prior knowledge of this SDK and minimal Hedera background.
  2. Avoid requiring knowledge of repository layout or contribution workflow.

PHILOSOPHY

  • Keep explanations high-level and conceptual; defer runnable examples to /examples.
  • Focus on what users need to know before diving into code examples.

Files:

  • docs/sdk_users/running_examples.md
tests/unit/**/*

⚙️ CodeRabbit configuration file

tests/unit/**/*: You are acting as a senior maintainer reviewing unit tests for the hiero-sdk-python project. Your goal is to ensure tests are extensive, deterministic, and protect against breaking changes.

CRITICAL PRINCIPLES - Tests Must Fail Loudly & Deterministically:

  • Tests must provide useful error messages when they fail for future debugging.
  • No print() statements - use assertions with descriptive messages.
  • No timing-dependent or unseeded random assertions.
  • No network calls or external dependencies (unit tests are isolated).
  • No unjustified TODOs or skipped tests without tracking issues.

PRIORITY 1 - Protect Against Breaking Changes:

  • Assert public attributes exist (e.g., assert hasattr(obj, 'account_id')).
  • Assert return types where relevant (e.g., assert isinstance(result, AccountId)).
  • Assert fluent setters return self (e.g., assert tx.set_memo("test") is tx).
  • Assert backward-compatible defaults are maintained.
  • If a breaking change is introduced, tests must assert deprecation behavior and test old behavior until removal.

PRIORITY 2 - Constructor & Setter Behavior:

  • Test constructor behavior with valid inputs, edge cases, and invalid inputs.
  • Test setter behavior including method chaining (fluent interface).
  • Verify that setters validate input and raise appropriate exceptions.
  • Test that getters return expected values after construction/setting.

PRIORITY 3 - Comprehensive Coverage:

  • Unit tests should be extensive - test even if we don't expect users to use it currently.
  • Cover happy paths AND unhappy paths/edge cases.
  • Test boundary conditions, null/None values, empty collections, etc.
  • Avoid brittle ordering assertions unless order is part of the contract.

PRIORITY 4 - No Mocks for Non-Existent Modules:

  • All imports must reference actual SDK modules - no hallucinated paths.
  • Validate import paths against the actual src/hiero_sdk_python structure.
  • Mocks should only be used for external de...

Files:

  • tests/unit/executable_test.py
  • tests/unit/account_create_transaction_test.py
🧬 Code graph analysis (51)
examples/account/account_allowance_approve_transaction_nft.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/schedule/schedule_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_airdrop_claim_auto.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_update_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_airdrop_transaction_cancel.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/account/account_allowance_delete_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/schedule/schedule_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_wipe_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/transaction/transfer_transaction_fungible.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/account/account_records_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/token_grant_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/revenue_generating_topics_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/schedule/schedule_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_create_transaction_wipe_key.py (3)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/unit/conftest.py (1)
  • private_key (54-56)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/integration/query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_create_transaction_max_automatic_token_associations_0.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/unit/executable_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_associate_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/query/transaction_record_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_allowance_delete_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_dissociate_transaction.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/account/account_allowance_approve_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/batch_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (2)
  • set_key_without_alias (94-107)
  • AccountCreateTransaction (27-380)
src/hiero_sdk_python/transaction/transaction.py (1)
  • batchify (825-840)
examples/query/account_balance_query_2.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_reject_transaction_fungible_token.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/unit/account_create_transaction_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (4)
  • set_key_without_alias (94-107)
  • set_key_with_alias (109-135)
  • AccountCreateTransaction (27-380)
  • set_alias (220-244)
src/hiero_sdk_python/crypto/private_key.py (2)
  • public_key (305-309)
  • PrivateKey (14-471)
examples/tokens/token_create_transaction_freeze_key.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/account_allowance_approve_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/consensus/topic_create_transaction_revenue_generating.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/logger/logging_example.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_airdrop_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/transaction/transfer_transaction_hbar.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_create_transaction_pause_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_revoke_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/token_update_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_create_transaction_kyc_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/transaction_record_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/account_update_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/integration/token_revoke_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_airdrop_claim_signature_required.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/schedule/schedule_sign_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/transaction/transfer_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/query/account_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/token_reject_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (2)
  • set_key_without_alias (94-107)
  • AccountCreateTransaction (27-380)
tests/integration/utils.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_grant_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/query/transaction_get_receipt_query.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/integration/account_info_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_reject_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis

@prishajaiswal75 prishajaiswal75 force-pushed the fix/deprecate-set-key-clean branch from a74ddf6 to 4379de6 Compare January 4, 2026 22:14
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (8)
examples/tokens/account_allowance_approve_transaction.py (1)

51-57: Missing freeze_with(client) breaks transaction lifecycle.

The transaction is missing freeze_with(client) before execute(client). According to SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute.

🔎 Proposed fix
 account_receipt = (
     AccountCreateTransaction()
     .set_key_without_alias(account_public_key)
     .set_initial_balance(Hbar(1))
     .set_account_memo("Account for token allowance")
+    .freeze_with(client)
     .execute(client)
 )
examples/account/account_allowance_delete_transaction_hbar.py (1)

42-47: Missing freeze_with(client) breaks transaction lifecycle.

Per SDK requirements, the transaction lifecycle must be: construction → freeze_with(client) → [sign (optional)] → execute(client). This transaction skips freeze_with.

🔎 Proposed fix
 account_receipt = (
     AccountCreateTransaction()
     .set_key_without_alias(account_public_key)
     .set_initial_balance(Hbar(1))
     .set_account_memo("Account for hbar allowance")
+    .freeze_with(client)
     .execute(client)
 )
examples/account/account_allowance_approve_transaction_hbar.py (1)

83-83: Optional: Simplify variable name.

The variable name account_account_id is redundant. Consider simplifying to account_id for consistency with other examples in the codebase.

🔎 Proposed refactor
-    account_account_id = account_receipt.account_id
+    account_id = account_receipt.account_id

-    return account_account_id, account_private_key
+    return account_id, account_private_key
tests/integration/account_update_transaction_e2e_test.py (5)

186-186: Incomplete replacement of deprecated set_key() method.

This line still uses the deprecated set_key() method, but the PR objective is to replace all deprecated usage with set_key_without_alias(). This creates inconsistency within the same file where other tests (lines 28, 104, 142, 341, 351) already use the new method.

🔎 Proposed fix
-        .set_key(env.operator_key.public_key())
+        .set_key_without_alias(env.operator_key.public_key())

238-238: Incomplete replacement of deprecated set_key() method.

This line still uses the deprecated set_key() method. For consistency with the rest of the file and the PR objective, it should use set_key_without_alias().

🔎 Proposed fix
-        .set_key(env.operator_key.public_key())
+        .set_key_without_alias(env.operator_key.public_key())

276-276: Incomplete replacement of deprecated set_key() method.

This line still uses the deprecated set_key() method. For consistency with the rest of the file and the PR objective, it should use set_key_without_alias().

🔎 Proposed fix
-        .set_key(env.operator_key.public_key())
+        .set_key_without_alias(env.operator_key.public_key())

305-305: Incomplete replacement of deprecated set_key() method.

This line still uses the deprecated set_key() method. For consistency with the rest of the file and the PR objective, it should use set_key_without_alias().

🔎 Proposed fix
-        .set_key(env.operator_key.public_key())
+        .set_key_without_alias(env.operator_key.public_key())

383-383: Incomplete replacement of deprecated set_key() method.

This line still uses the deprecated set_key() method. For consistency with the rest of the file and the PR objective, it should use set_key_without_alias().

🔎 Proposed fix
-        .set_key(env.operator_key.public_key())
+        .set_key_without_alias(env.operator_key.public_key())
♻️ Duplicate comments (7)
examples/tokens/token_dissociate_transaction.py (1)

57-57: Remove or clarify the inline comment.

The comment # <-- THE FIX: Call as a method is misleading and contributor-focused. It was always a method call—the actual change is replacing the deprecated set_key() with set_key_without_alias(). Since examples are copied by users, either remove this comment or replace it with something user-facing that explains the SDK behavior:

.set_key_without_alias(recipient_key.public_key())  # Associates key without creating an alias
examples/tokens/token_reject_transaction_nft.py (1)

57-62: Missing freeze_with(client) in transaction lifecycle.

The AccountCreateTransaction calls .execute(client) without first calling .freeze_with(client). This violates the SDK transaction lifecycle pattern (construction → freeze_with → sign → execute).

🔎 Proposed fix
     receipt = (
         AccountCreateTransaction()
         .set_key_without_alias(new_account_public_key)
         .set_initial_balance(Hbar(1))
+        .freeze_with(client)
         .execute(client)
     )
examples/consensus/topic_create_transaction_revenue_generating.py (1)

66-71: Missing freeze_with(client) breaks transaction lifecycle.

The transaction is missing freeze_with(client) before execute(client). According to SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute. This issue was previously flagged but remains unresolved.

🔎 Proposed fix
 receipt = (
     AccountCreateTransaction()
     .set_key_without_alias(account_public_key)
     .set_initial_balance(initial_balance)
+    .freeze_with(client)
     .execute(client)
 )
examples/tokens/token_reject_transaction_fungible_token.py (1)

55-60: Missing freeze_with(client) for pattern consistency.

As noted in a previous review, this AccountCreateTransaction should include freeze_with(client) before execute() to maintain consistency with other transactions in this file.

examples/tokens/token_create_transaction_wipe_key.py (1)

76-81: Missing freeze_with(client) breaks transaction lifecycle.

The transaction is missing freeze_with(client) before execute(client). According to SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute.

🔎 Proposed fix
 tx = (
     AccountCreateTransaction()
     .set_key_without_alias(private_key.public_key())
     .set_initial_balance(Hbar(2))
+    .freeze_with(client)
 )
 receipt = tx.execute(client)
examples/query/account_balance_query_2.py (1)

57-62: Missing freeze_with(client) breaks transaction lifecycle.

This issue has already been flagged in a previous review. The transaction lifecycle must include freeze_with(client) before execute(client).

tests/unit/account_create_transaction_test.py (1)

188-193: Fix syntax error - mismatched parentheses.

Line 192 has an extra closing parenthesis that will cause a syntax error. This issue was previously flagged in a past review but remains unfixed.

🔎 Proposed fix
     account_tx = (
         AccountCreateTransaction()
         .set_key_without_alias(new_public_key)
         .set_initial_balance(100000000)
-        .set_account_memo("Test account"))
+        .set_account_memo("Test account")
     )
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a74ddf6 and 56ef986.

📒 Files selected for processing (53)
  • CHANGELOG.md
  • docs/sdk_users/running_examples.md
  • examples/account/account_allowance_approve_transaction_hbar.py
  • examples/account/account_allowance_approve_transaction_nft.py
  • examples/account/account_allowance_delete_transaction_hbar.py
  • examples/account/account_allowance_delete_transaction_nft.py
  • examples/account/account_create_transaction.py
  • examples/account/account_delete_transaction.py
  • examples/account/account_records_query.py
  • examples/account/account_update_transaction.py
  • examples/consensus/topic_create_transaction_revenue_generating.py
  • examples/logger/logging_example.py
  • examples/query/account_balance_query_2.py
  • examples/query/account_info_query.py
  • examples/query/transaction_get_receipt_query.py
  • examples/query/transaction_record_query.py
  • examples/schedule/schedule_create_transaction.py
  • examples/schedule/schedule_delete_transaction.py
  • examples/schedule/schedule_info_query.py
  • examples/schedule/schedule_sign_transaction.py
  • examples/tokens/account_allowance_approve_transaction.py
  • examples/tokens/token_airdrop_claim_auto.py
  • examples/tokens/token_airdrop_claim_signature_required.py
  • examples/tokens/token_airdrop_transaction.py
  • examples/tokens/token_airdrop_transaction_cancel.py
  • examples/tokens/token_associate_transaction.py
  • examples/tokens/token_create_transaction_freeze_key.py
  • examples/tokens/token_create_transaction_kyc_key.py
  • examples/tokens/token_create_transaction_max_automatic_token_associations_0.py
  • examples/tokens/token_create_transaction_pause_key.py
  • examples/tokens/token_create_transaction_wipe_key.py
  • examples/tokens/token_dissociate_transaction.py
  • examples/tokens/token_grant_kyc_transaction.py
  • examples/tokens/token_reject_transaction_fungible_token.py
  • examples/tokens/token_reject_transaction_nft.py
  • examples/tokens/token_revoke_kyc_transaction.py
  • examples/tokens/token_wipe_transaction.py
  • examples/transaction/transfer_transaction_fungible.py
  • examples/transaction/transfer_transaction_hbar.py
  • examples/transaction/transfer_transaction_nft.py
  • tests/integration/account_info_query_e2e_test.py
  • tests/integration/account_update_transaction_e2e_test.py
  • tests/integration/batch_transaction_e2e_test.py
  • tests/integration/query_e2e_test.py
  • tests/integration/revenue_generating_topics_e2e_test.py
  • tests/integration/token_grant_kyc_transaction_e2e_test.py
  • tests/integration/token_reject_transaction_e2e_test.py
  • tests/integration/token_revoke_kyc_transaction_e2e_test.py
  • tests/integration/token_update_transaction_e2e_test.py
  • tests/integration/transaction_record_query_e2e_test.py
  • tests/integration/utils.py
  • tests/unit/account_create_transaction_test.py
  • tests/unit/executable_test.py
🧰 Additional context used
📓 Path-based instructions (5)
examples/**/*

⚙️ CodeRabbit configuration file

examples/**/*: You are acting as a senior maintainer reviewing SDK examples. Your goal is to ensure examples work verbatim for users who copy-paste them.

Priority 1 - Correctness:

  • Verify transaction lifecycle chain (construction -> freeze_with -> sign -> execute).
  • Ensure freeze_with(client) is called BEFORE signing.
  • Validate that methods referenced actually exist in the hiero_sdk_python codebase.
  • Ensure response validation checks receipt.status against ResponseCode enums (e.g., ResponseCode.SUCCESS).

Priority 2 - Transaction Lifecycle:

  • Check method chaining logic.
  • Verify correct signing order (especially for multi-sig).
  • Ensure explicit .execute(client) calls.
  • Verify response property extraction (e.g., using .token_id, .account_id, .serial_numbers).
  • Ensure error handling uses ResponseCode(receipt.status).name for clarity.

Priority 3 - Naming & Clarity:

  • Enforce role-based naming: operator_id/_key, treasury_account_id/_key, receiver_id/_key.
  • Use _id suffix for AccountId and _key suffix for PrivateKey variables.
  • Validate negative examples explicitly check for failure codes (e.g., TOKEN_HAS_NO_PAUSE_KEY).
  • Ensure logical top-to-bottom flow without ambiguity.

Priority 4 - Consistency:

  • Verify standard patterns: def main(), if __name__ == "__main__":, load_dotenv().
  • IMPORT RULES:
    1. Accept both top-level imports (e.g., from hiero_sdk_python import PrivateKey) and fully qualified imports (e.g., from hiero_sdk_python.crypto.private_key import PrivateKey).
    2. STRICTLY validate that the import path actually exists in the project structure. Compare against other files in /examples or your knowledge of the SDK file tree.
    3. Flag hallucinations immediately (e.g., hiero_sdk_python.keys does not exist).
  • Check for try-except blocks with sys.exit(1) for critical failures.

Priority 5 - User Experience:

  • Ensure comments explain SDK usage patterns (for users,...

Files:

  • examples/tokens/token_airdrop_claim_signature_required.py
  • examples/tokens/token_create_transaction_kyc_key.py
  • examples/tokens/token_airdrop_transaction.py
  • examples/account/account_allowance_delete_transaction_nft.py
  • examples/tokens/token_create_transaction_pause_key.py
  • examples/account/account_update_transaction.py
  • examples/tokens/token_airdrop_transaction_cancel.py
  • examples/account/account_records_query.py
  • examples/schedule/schedule_info_query.py
  • examples/account/account_allowance_approve_transaction_nft.py
  • examples/consensus/topic_create_transaction_revenue_generating.py
  • examples/tokens/token_revoke_kyc_transaction.py
  • examples/tokens/token_create_transaction_wipe_key.py
  • examples/tokens/token_airdrop_claim_auto.py
  • examples/schedule/schedule_sign_transaction.py
  • examples/transaction/transfer_transaction_nft.py
  • examples/query/account_balance_query_2.py
  • examples/transaction/transfer_transaction_hbar.py
  • examples/schedule/schedule_delete_transaction.py
  • examples/query/account_info_query.py
  • examples/tokens/token_associate_transaction.py
  • examples/tokens/account_allowance_approve_transaction.py
  • examples/tokens/token_wipe_transaction.py
  • examples/account/account_delete_transaction.py
  • examples/tokens/token_reject_transaction_fungible_token.py
  • examples/tokens/token_dissociate_transaction.py
  • examples/account/account_allowance_approve_transaction_hbar.py
  • examples/schedule/schedule_create_transaction.py
  • examples/transaction/transfer_transaction_fungible.py
  • examples/query/transaction_get_receipt_query.py
  • examples/tokens/token_create_transaction_freeze_key.py
  • examples/account/account_allowance_delete_transaction_hbar.py
  • examples/tokens/token_create_transaction_max_automatic_token_associations_0.py
  • examples/tokens/token_grant_kyc_transaction.py
  • examples/query/transaction_record_query.py
  • examples/account/account_create_transaction.py
  • examples/logger/logging_example.py
  • examples/tokens/token_reject_transaction_nft.py
tests/unit/**/*

⚙️ CodeRabbit configuration file

tests/unit/**/*: You are acting as a senior maintainer reviewing unit tests for the hiero-sdk-python project. Your goal is to ensure tests are extensive, deterministic, and protect against breaking changes.

CRITICAL PRINCIPLES - Tests Must Fail Loudly & Deterministically:

  • Tests must provide useful error messages when they fail for future debugging.
  • No print() statements - use assertions with descriptive messages.
  • No timing-dependent or unseeded random assertions.
  • No network calls or external dependencies (unit tests are isolated).
  • No unjustified TODOs or skipped tests without tracking issues.

PRIORITY 1 - Protect Against Breaking Changes:

  • Assert public attributes exist (e.g., assert hasattr(obj, 'account_id')).
  • Assert return types where relevant (e.g., assert isinstance(result, AccountId)).
  • Assert fluent setters return self (e.g., assert tx.set_memo("test") is tx).
  • Assert backward-compatible defaults are maintained.
  • If a breaking change is introduced, tests must assert deprecation behavior and test old behavior until removal.

PRIORITY 2 - Constructor & Setter Behavior:

  • Test constructor behavior with valid inputs, edge cases, and invalid inputs.
  • Test setter behavior including method chaining (fluent interface).
  • Verify that setters validate input and raise appropriate exceptions.
  • Test that getters return expected values after construction/setting.

PRIORITY 3 - Comprehensive Coverage:

  • Unit tests should be extensive - test even if we don't expect users to use it currently.
  • Cover happy paths AND unhappy paths/edge cases.
  • Test boundary conditions, null/None values, empty collections, etc.
  • Avoid brittle ordering assertions unless order is part of the contract.

PRIORITY 4 - No Mocks for Non-Existent Modules:

  • All imports must reference actual SDK modules - no hallucinated paths.
  • Validate import paths against the actual src/hiero_sdk_python structure.
  • Mocks should only be used for external de...

Files:

  • tests/unit/executable_test.py
  • tests/unit/account_create_transaction_test.py
tests/integration/**/*

⚙️ CodeRabbit configuration file

tests/integration/**/*: You are acting as a senior maintainer reviewing integration tests for the hiero-sdk-python project. Your goal is to ensure end-to-end tests validate real network behavior safely and deterministically.

CRITICAL PRINCIPLES - Safety & Diagnosability:

  • Prioritize safety: No implicit or default mainnet usage.
  • Secrets and credentials must be injected safely (env vars, not hardcoded).
  • Test failures must be diagnosable with clear error messages.
  • Tests must assert observable network behavior, not just SUCCESS.
  • Failure-path tests must assert specific ResponseCode values (e.g., TOKEN_HAS_NO_PAUSE_KEY).

PRIORITY 1 - End-to-End Behavior:

  • Tests should be end-to-end: construct → freeze → sign → execute → verify.
  • Validate resulting balances, ownership, and state changes (not just transaction success).
  • Assert transaction receipts contain expected data (IDs, serial numbers, etc.).
  • Verify network state after operations (e.g., account balance changed, token transferred).

PRIORITY 2 - Test Structure & Maintainability:

  • One major behavior per test (clear focus).
  • Tests should be readable: clear names, brief docstrings, key inline comments.
  • Minimal abstraction layers - prefer clarity over DRY.
  • Is the file too monolithic? Flag if tests should be split into smaller modules.
  • Are helper functions good candidates for pytest fixtures or shared utilities?

PRIORITY 3 - Isolation & Cleanup:

  • Local account creation over operator reuse (avoid state pollution).
  • Are accounts, tokens, and allowances properly cleaned up to avoid state leakage?
  • Recommend teardown strategies or fixture scoping improvements.
  • Tests should not depend on execution order (avoid brittle assumptions).

PRIORITY 4 - Assertions & Coverage:

  • Do tests validate only success/failure, or also assert resulting state?
  • Suggest additional assertions that would strengthen correctness (balances, allowances, ownership).
  • Cover happy paths AND ...

Files:

  • tests/integration/utils.py
  • tests/integration/batch_transaction_e2e_test.py
  • tests/integration/account_update_transaction_e2e_test.py
  • tests/integration/transaction_record_query_e2e_test.py
  • tests/integration/token_reject_transaction_e2e_test.py
  • tests/integration/query_e2e_test.py
  • tests/integration/account_info_query_e2e_test.py
  • tests/integration/revenue_generating_topics_e2e_test.py
  • tests/integration/token_update_transaction_e2e_test.py
  • tests/integration/token_revoke_kyc_transaction_e2e_test.py
  • tests/integration/token_grant_kyc_transaction_e2e_test.py
docs/**

⚙️ CodeRabbit configuration file

docs/**: You are reviewing documentation for the Hiero Python SDK. These pages serve both SDK users and SDK developers.

Priority 1 - Correctness (code, commands, links)

  1. Verify code snippets conceptually run and match the current SDK API.
  2. Check shell commands and workflow steps against actual project tooling.
  3. Validate URLs and cross-references; flag broken or misleading links.

Priority 2 - Clarity and completeness

  1. Ensure each page states its purpose and expected outcome early.
  2. Prefer concrete, step-wise explanations over vague descriptions.
  3. Highlight missing prerequisites that would block a reader.
  4. For larger gaps, suggest filing a follow-up issue instead of blocking.

Priority 3 - Consistency and navigation

  1. Encourage consistent terminology with the SDK and examples.
  2. Check headings form a logical reading path.
  3. Confirm each page makes clear which audience it serves.

PHILOSOPHY

  • Treat docs as work-in-progress: optimize for correctness and clarity over perfection.
  • Keep feedback concise, action-oriented, and focused on reader success.
  • Do not request large-scale restructures unless current structure blocks understanding.

AVOID

  • Avoid lint-style feedback on Markdown formatting or minor wording.
  • Avoid proposing new conventions without clear benefit.
  • Avoid turning every high-level gap into a blocker.

Files:

  • docs/sdk_users/running_examples.md
docs/sdk_users/**

⚙️ CodeRabbit configuration file

docs/sdk_users/**: These documents are for SDK users who want to USE the Hiero Python SDK quickly and correctly.

Priority 1 - High-level guidance

  1. Ensure explanations are conceptual and point to /examples for runnable code.
  2. Check that required environment variables and network choices are clearly stated.

Priority 2 - No hidden assumptions

  1. Assume zero prior knowledge of this SDK and minimal Hedera background.
  2. Avoid requiring knowledge of repository layout or contribution workflow.

PHILOSOPHY

  • Keep explanations high-level and conceptual; defer runnable examples to /examples.
  • Focus on what users need to know before diving into code examples.

Files:

  • docs/sdk_users/running_examples.md
🧬 Code graph analysis (48)
examples/tokens/token_airdrop_claim_signature_required.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_create_transaction_kyc_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/unit/executable_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (2)
  • PrivateKey (14-471)
  • public_key (305-309)
examples/tokens/token_airdrop_transaction.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/account/account_allowance_delete_transaction_nft.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_create_transaction_pause_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_update_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/utils.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/integration/batch_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (2)
  • set_key_without_alias (94-107)
  • AccountCreateTransaction (27-380)
src/hiero_sdk_python/transaction/transaction.py (1)
  • batchify (825-840)
tests/integration/account_update_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/utils.py (1)
  • env (23-27)
examples/tokens/token_airdrop_transaction_cancel.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/account/account_records_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/schedule/schedule_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_allowance_approve_transaction_nft.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/consensus/topic_create_transaction_revenue_generating.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/transaction_record_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_revoke_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_airdrop_claim_auto.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/schedule/schedule_sign_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/transaction/transfer_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/query/account_balance_query_2.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/transaction/transfer_transaction_hbar.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/integration/token_reject_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (2)
  • set_key_without_alias (94-107)
  • AccountCreateTransaction (27-380)
tests/integration/query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/schedule/schedule_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/account_info_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/query/account_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_associate_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/account_allowance_approve_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_wipe_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_reject_transaction_fungible_token.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_dissociate_transaction.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/integration/revenue_generating_topics_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/account/account_allowance_approve_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/schedule/schedule_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/transaction/transfer_transaction_fungible.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/integration/token_revoke_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/query/transaction_get_receipt_query.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_create_transaction_freeze_key.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/account/account_allowance_delete_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_create_transaction_max_automatic_token_associations_0.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_grant_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/query/transaction_record_query.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/integration/token_grant_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/logger/logging_example.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_reject_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (45)
examples/schedule/schedule_sign_transaction.py (1)

57-65: LGTM! Correct deprecation fix with proper transaction lifecycle.

The change from set_key() to set_key_without_alias() correctly addresses the deprecation. The transaction lifecycle is correct: construction → freeze_with → sign → execute, with freeze_with(client) properly called before signing. The pattern of setting the public key and signing with the private key is correct.

examples/transaction/transfer_transaction_nft.py (1)

59-59: LGTM! Deprecation replacement is correct.

The change from set_key() to set_key_without_alias() properly addresses the deprecation. The method exists in the SDK (as confirmed by the relevant code snippet) and correctly accepts a PublicKey. The transaction lifecycle (construct → freeze_with → execute) is appropriate for AccountCreateTransaction where the operator's signature is automatically applied.

examples/transaction/transfer_transaction_fungible.py (1)

57-62: LGTM! Correct replacement of deprecated method.

The change from .set_key() to .set_key_without_alias() correctly updates to the non-deprecated API. The transaction lifecycle is correct: construction → freeze_with(client)sign(operator_key)execute(client).

examples/tokens/token_airdrop_transaction_cancel.py (1)

56-64: LGTM! Correct deprecation replacement and transaction lifecycle.

The replacement of .set_key() with .set_key_without_alias() is correct and aligns with the PR objectives. The transaction lifecycle follows best practices:

  • Transaction construction (lines 56-60)
  • freeze_with(client) called before signing (line 61)
  • Proper signing and execution chain (line 61)
  • Correct response extraction (line 62)

The method exists in the codebase and accepts the correct parameter type (PublicKey from recipient_key.public_key()).

examples/tokens/token_airdrop_claim_signature_required.py (1)

99-108: LGTM! Correct deprecation fix.

The replacement of deprecated set_key() with set_key_without_alias() is correct. The transaction lifecycle follows best practices:

  • Proper method chaining
  • freeze_with(client) called before signing
  • Signing with receiver_key (required because signature_required=True)
  • Explicit execute(client) call

The use of receiver_public_key is appropriate for account creation.

examples/tokens/token_create_transaction_pause_key.py (1)

197-197: LGTM! Correct replacement of deprecated method.

The change from set_key() to set_key_without_alias() correctly addresses the deprecation. The transaction lifecycle (freeze_with → sign → execute) is properly maintained, and using the public key for account creation follows SDK best practices. The comment clarifies this for users copying the example.

examples/account/account_allowance_approve_transaction_nft.py (1)

84-90: LGTM! Deprecated method correctly replaced.

The change from .set_key(public_key) to .set_key_without_alias(public_key) correctly replaces the deprecated method. The use of set_key_without_alias is appropriate here since no alias is being set, and the method signature accepts both PrivateKey and PublicKey per the SDK implementation.

Transaction lifecycle is correct: AccountCreateTransaction is executed directly without freeze_with since no additional signatures beyond the operator are required.

CHANGELOG.md (1)

137-138: LGTM!

The changelog entry accurately documents the deprecation replacement across examples and tests.

examples/account/account_records_query.py (1)

50-50: LGTM!

The replacement of deprecated set_key() with set_key_without_alias() is correct. The transaction lifecycle properly calls freeze_with(client) before execute(client).

examples/query/transaction_get_receipt_query.py (1)

52-52: LGTM!

The replacement of deprecated set_key() with set_key_without_alias() is correct. The transaction lifecycle is proper with freeze_with(client) called before execution on line 55.

examples/tokens/token_revoke_kyc_transaction.py (1)

111-111: LGTM!

The replacement of deprecated set_key() with set_key_without_alias() is correct. The transaction lifecycle properly calls freeze_with(client) before execution on line 113.

examples/logger/logging_example.py (1)

110-116: LGTM! Transaction lifecycle is correct.

The replacement of set_key() with set_key_without_alias() is properly integrated. The transaction chain correctly follows: construction → freeze_with(client)sign()execute().

examples/tokens/token_create_transaction_max_automatic_token_associations_0.py (1)

93-101: LGTM! Transaction lifecycle is correct.

The replacement of set_key() with set_key_without_alias() is properly integrated. The transaction correctly chains: construction → freeze_with(client)sign()execute().

examples/schedule/schedule_info_query.py (1)

50-58: LGTM! Transaction lifecycle is correct.

The replacement of set_key() with set_key_without_alias() is properly integrated. The transaction correctly follows the required lifecycle: construction → freeze_with(client)sign()execute().

examples/transaction/transfer_transaction_hbar.py (1)

49-73: LGTM! Correct API migration.

The change from set_key() to set_key_without_alias() is correct, and the transaction lifecycle follows best practices: construct → freeze_with → sign → execute.

tests/integration/revenue_generating_topics_e2e_test.py (2)

529-539: LGTM! Correct API usage in test.

The change to set_key_without_alias() is correct. The account is properly created with fee_exempt_key1 and used in the test flow to verify fee exemption behavior.


592-602: LGTM! Correct API usage in test.

The change to set_key_without_alias() is correct and consistent with the pattern used in the other fee-exempt test above.

examples/tokens/token_create_transaction_kyc_key.py (1)

76-112: LGTM! Correct API migration with proper transaction lifecycle.

The change to set_key_without_alias() is correct, and the function properly demonstrates the transaction lifecycle with freeze_with → sign → execute.

examples/tokens/token_reject_transaction_fungible_token.py (1)

57-57: LGTM! Correct API migration.

The change from set_key() to set_key_without_alias() is correct.

examples/tokens/token_create_transaction_freeze_key.py (1)

177-196: LGTM! Correct API migration with exemplary transaction lifecycle.

The change to set_key_without_alias() is correct, and this function demonstrates the proper transaction pattern: construct → freeze_with → sign → execute.

examples/tokens/token_airdrop_claim_auto.py (1)

92-92: LGTM - Correct migration to non-deprecated API.

The replacement of set_key() with set_key_without_alias() is correct and maintains the proper transaction lifecycle (construct → freeze_with → sign → execute).

tests/integration/batch_transaction_e2e_test.py (1)

280-301: LGTM - Consistent migration across batch transaction test.

All three AccountCreateTransaction instances correctly use set_key_without_alias() instead of the deprecated set_key(). The transaction lifecycle is properly maintained with .batchify() handling freeze and sign operations.

tests/integration/utils.py (1)

59-59: LGTM - Test utility correctly updated.

The migration to set_key_without_alias() is correct. The helper function maintains proper account creation flow for integration tests.

tests/unit/executable_test.py (1)

55-55: LGTM - Consistent migration across unit tests.

All nine occurrences of set_key_without_alias() correctly replace the deprecated set_key(). These unit tests focus on retry/error handling behavior, and the migration doesn't affect their test logic. Transaction lifecycle is properly maintained across all test cases.

Also applies to: 78-78, 118-118, 155-155, 191-191, 222-222, 256-256, 294-294, 410-410

examples/query/transaction_record_query.py (1)

57-57: LGTM - Example correctly updated.

The replacement of set_key() with set_key_without_alias() is correct and demonstrates proper SDK usage. The example maintains the correct transaction flow and response validation.

examples/query/account_info_query.py (1)

57-57: LGTM! Method replacement is correct.

The change from set_key() to set_key_without_alias() aligns with the SDK API update, and the transaction lifecycle is complete (freeze_with → sign → execute).

examples/tokens/token_grant_kyc_transaction.py (1)

108-108: LGTM! Method replacement is correct.

The change from set_key() to set_key_without_alias() aligns with the SDK API update, and the transaction lifecycle is complete (freeze_with → execute).

examples/tokens/token_associate_transaction.py (1)

78-78: LGTM! Method replacement is correct.

The change from set_key() to set_key_without_alias() aligns with the SDK API update, and the transaction lifecycle is complete (freeze_with → sign → execute).

examples/schedule/schedule_create_transaction.py (1)

46-54: LGTM!

The transaction lifecycle is correct (construction → freeze_with → sign → execute), and the replacement of set_key() with set_key_without_alias() is appropriate.

examples/schedule/schedule_delete_transaction.py (1)

51-59: LGTM!

The transaction lifecycle is correct (construction → freeze_with → sign → execute), and the replacement of set_key() with set_key_without_alias() is appropriate.

examples/account/account_update_transaction.py (1)

45-53: LGTM!

The transaction lifecycle is correct (construction → freeze_with → sign → execute), and the replacement of set_key() with set_key_without_alias() is appropriate.

tests/integration/query_e2e_test.py (1)

25-25: LGTM: Correct replacement of deprecated method.

The replacement of .set_key() with .set_key_without_alias() is correct and aligns with the SDK's updated API. All five test functions properly use the new method while maintaining the same transaction lifecycle and test logic.

Also applies to: 75-75, 132-132, 171-171, 217-217

examples/account/account_create_transaction.py (1)

78-78: LGTM: Proper deprecation replacement with correct transaction lifecycle.

The replacement of .set_key() with .set_key_without_alias() is correct. The transaction lifecycle follows best practices: construction → freeze_with(client)sign(operator_key)execute(client).

examples/tokens/token_wipe_transaction.py (1)

55-55: LGTM: Correct deprecation replacement.

The replacement of .set_key() with .set_key_without_alias() is correct. The transaction is properly frozen with freeze_with(client) before execution, relying on implicit operator signing which is valid for this use case.

tests/integration/token_revoke_kyc_transaction_e2e_test.py (1)

23-23: LGTM: Correct deprecation replacement with proper test assertions.

The replacement of .set_key() with .set_key_without_alias() is correct across all three test functions. The tests properly validate both success and failure paths with specific ResponseCode assertions (e.g., TOKEN_HAS_NO_KYC_KEY, TOKEN_NOT_ASSOCIATED_TO_ACCOUNT), which aligns with integration testing best practices.

Also applies to: 75-75, 127-127

examples/account/account_delete_transaction.py (1)

27-27: LGTM: Correct deprecation replacement with proper transaction lifecycle.

The replacement of .set_key() with .set_key_without_alias() is correct. The transaction lifecycle properly follows the pattern: construction → freeze_with(client)sign(account_private_key)execute(client).

tests/integration/account_info_query_e2e_test.py (1)

31-31: LGTM: Deprecation fix applied correctly.

The change from set_key() to set_key_without_alias() correctly addresses the deprecation. The method signature and usage pattern remain consistent with the existing code.

docs/sdk_users/running_examples.md (1)

123-123: LGTM: Documentation updated correctly.

The Method Chaining example now uses set_key_without_alias() which aligns with the current SDK API. The example maintains the proper transaction lifecycle with freeze_with(), sign(), and execute().

examples/account/account_allowance_delete_transaction_nft.py (1)

73-73: LGTM: Correct deprecation fix.

The change to set_key_without_alias() correctly replaces the deprecated set_key() method. The function follows proper variable naming conventions with _key suffix for PrivateKey and _id suffix for AccountId.

examples/account/account_allowance_approve_transaction_hbar.py (1)

70-70: LGTM: Correct deprecation fix.

The change to set_key_without_alias() correctly replaces the deprecated set_key() method.

examples/tokens/token_airdrop_transaction.py (1)

59-59: LGTM: Correct deprecation fix with proper transaction lifecycle.

The change to set_key_without_alias() correctly replaces the deprecated method. The transaction also follows the proper lifecycle with freeze_with()sign()execute(), which aligns with SDK best practices.

tests/integration/token_reject_transaction_e2e_test.py (1)

116-116: LGTM! Consistent replacement of deprecated method.

All fluent API calls to set_key() have been correctly replaced with set_key_without_alias() throughout the file. The changes align with the PR objective and maintain consistency across the test suite.

Also applies to: 177-177, 883-883, 903-903

tests/unit/account_create_transaction_test.py (1)

45-45: LGTM! Comprehensive replacement of deprecated method.

All test cases have been correctly updated to use set_key_without_alias() instead of the deprecated set_key() method. The changes maintain proper fluent interface chaining and test coverage.

Also applies to: 70-70, 105-105, 170-170, 190-190, 237-237, 386-386, 394-394

tests/integration/token_grant_kyc_transaction_e2e_test.py (1)

22-22: LGTM! Complete and consistent replacement.

All three account creation calls in this file have been correctly updated to use set_key_without_alias(). The changes are consistent across all test cases.

Also applies to: 65-65, 119-119

tests/integration/transaction_record_query_e2e_test.py (1)

25-25: LGTM! Correct replacement of deprecated method.

The deprecated set_key() method has been correctly replaced with set_key_without_alias(), aligning with the PR objective.

@exploreriii
Copy link
Contributor

exploreriii commented Jan 4, 2026

Yes, so, well done! you have solved the issue
However, we need certain things for your PR to qualify to be able to be merged, solving the issue is just one of them.
Additionally, we need your commits to be signed correctly (git commit -S -s -m "..."), so this needs both a DCO and GPG sign.

Once that's done, that check will pass :)
Screenshot 2026-01-04 at 22 52 56

You can read our signing.md guide

@prishajaiswal75 prishajaiswal75 force-pushed the fix/deprecate-set-key-clean branch from 56ef986 to 2a2e33d Compare January 4, 2026 23:00
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (6)
tests/integration/account_update_transaction_e2e_test.py (1)

184-189: Incomplete migration: 5 remaining deprecated set_key() calls in AccountCreateTransaction.

AccountCreateTransaction.set_key() is deprecated (marked with DeprecationWarning in the SDK). These 5 calls should be migrated to set_key_without_alias():

  • Line 186 in test_integration_account_update_transaction_invalid_auto_renew_period
  • Line 238 in test_account_update_insufficient_fee_with_valid_expiration_bump
  • Line 276 in test_integration_account_update_transaction_with_only_account_id
  • Line 305 in test_integration_account_update_transaction_with_max_automatic_token_associations
  • Line 383 in test_integration_account_update_transaction_with_staked_node_id

Note: There is also an AccountUpdateTransaction.set_key() at line 51 that may need similar review depending on your PR scope.

tests/integration/account_info_query_e2e_test.py (1)

29-35: Critical: Missing freeze_with(client) violates transaction lifecycle.

The transaction skips freeze_with(client) before execute(client). Per SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute. Even though this test may currently pass, it doesn't follow the documented transaction pattern and may break if SDK enforcement changes.

🔎 Proposed fix
 receipt = (
     AccountCreateTransaction()
     .set_key_without_alias(new_account_public_key)
     .set_initial_balance(Hbar(1))
     .set_account_memo(account_memo)
+    .freeze_with(client)
     .execute(client)
 )
examples/account/account_allowance_delete_transaction_hbar.py (1)

56-56: Consider renaming for clarity.

The variable name account_account_id is redundant. Consider simplifying to account_id for better readability.

🔎 Proposed refactor
-    account_account_id = account_receipt.account_id
+    account_id = account_receipt.account_id

-    return account_account_id, account_private_key
+    return account_id, account_private_key
tests/unit/account_create_transaction_test.py (1)

287-287: Fix typo in function name.

The function name contains a typo: "seperate" should be "separate".

🔎 Proposed fix
-def test_create_account_transaction_set_key_with_seperate_key_for_alias(mock_account_ids):
-    """Test Create account transaction using set_key_with_alias method with seprate key"""
+def test_create_account_transaction_set_key_with_separate_key_for_alias(mock_account_ids):
+    """Test Create account transaction using set_key_with_alias method with separate key"""
examples/tokens/token_revoke_kyc_transaction.py (2)

2-3: Fix typo in usage examples.

The file extension is duplicated - should be .py not .py.py. Users copying these commands would encounter file-not-found errors.

🔎 Proposed fix
-uv run examples/tokens/token_revoke_kyc_transaction.py.py
-python examples/tokens/token_revoke_kyc_transaction.py.py
+uv run examples/tokens/token_revoke_kyc_transaction.py
+python examples/tokens/token_revoke_kyc_transaction.py

51-67: Add freeze_with(client) to TokenCreateTransaction for consistency.

The TokenCreateTransaction at lines 51-67 executes directly without freeze_with(client), which is inconsistent with all other transactions in this example: TokenAssociateTransaction (line 87), AccountCreateTransaction (line 113), TokenGrantKycTransaction (line 138), and TokenRevokeKycTransaction (line 184) all use freeze_with(client) before signing and executing.

Per the transaction lifecycle (construction → freeze_with → sign → execute), add .freeze_with(client) before .execute(client) to align with the pattern used elsewhere in this file.

♻️ Duplicate comments (9)
examples/tokens/token_dissociate_transaction.py (1)

57-57: Remove or clarify the contributor-focused inline comment.

The comment # <-- THE FIX: Call as a method is misleading—it was always a method call. The actual change is replacing the deprecated set_key() with set_key_without_alias(). Since examples are copied by users, either remove this contributor-focused comment or replace it with a user-facing explanation:

.set_key_without_alias(recipient_key.public_key())  # Assigns key without creating an account alias
examples/consensus/topic_create_transaction_revenue_generating.py (1)

66-71: Missing freeze_with(client) breaks transaction lifecycle.

The account creation transaction is missing freeze_with(client) before execute(client). According to SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute.

🔎 Proposed fix
 receipt = (
     AccountCreateTransaction()
     .set_key_without_alias(account_public_key)
     .set_initial_balance(initial_balance)
+    .freeze_with(client)
     .execute(client)
 )
tests/integration/token_update_transaction_e2e_test.py (2)

111-116: Missing freeze_with(client) breaks transaction lifecycle.

Integration tests must follow the correct SDK transaction lifecycle: construction → freeze_with → sign → execute. This transaction is missing freeze_with(client) before execute().

🔎 Proposed fix
 tx = (
     AccountCreateTransaction()
     .set_key_without_alias(keys[0].public_key())
     .set_initial_balance(Hbar(2))
+    .freeze_with(env.client)
 )
 receipt = tx.execute(env.client)

175-180: Missing freeze_with(client) breaks transaction lifecycle.

Integration tests must follow the correct SDK transaction lifecycle: construction → freeze_with → sign → execute. This transaction is missing freeze_with(client) before execute().

🔎 Proposed fix
 receipt = (
     AccountCreateTransaction()
     .set_key_without_alias(new_public_key)
     .set_initial_balance(Hbar(2))
+    .freeze_with(env.client)
     .execute(env.client)
 )
examples/tokens/token_create_transaction_wipe_key.py (1)

76-81: Missing freeze_with(client) breaks transaction lifecycle.

The transaction is missing freeze_with(client) before execute(client). According to SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute.

🔎 Proposed fix
 tx = (
     AccountCreateTransaction()
     .set_key_without_alias(private_key.public_key())
     .set_initial_balance(Hbar(2))
+    .freeze_with(client)
 )
-receipt = tx.execute(client)
+receipt = tx.execute(client)
examples/tokens/token_reject_transaction_fungible_token.py (1)

55-60: Add freeze_with(client) for pattern consistency.

This AccountCreateTransaction is the only transaction in the file that calls .execute() directly without freeze_with(). All other transactions (TokenCreateTransaction at line 91, TokenAssociateTransaction at line 117, TransferTransaction at line 140, TokenRejectTransaction at line 204) include the freeze_with(client) call. For consistency and to demonstrate best practices, add it here.

🔎 Proposed fix
 receipt = (
     AccountCreateTransaction()
     .set_key_without_alias(new_account_public_key)
     .set_initial_balance(Hbar(1))
+    .freeze_with(client)
     .execute(client)
 )
examples/query/account_balance_query_2.py (1)

57-62: Critical: Missing freeze_with(client) violates transaction lifecycle.

Per SDK requirements, the transaction lifecycle must be: construction → freeze_with → sign → execute. This transaction skips freeze_with(client) before execute(client).

🔎 Proposed fix
 receipt = (
     AccountCreateTransaction()
     .set_key_without_alias(account_public_key)
     .set_initial_balance(initial_balance)
+    .freeze_with(client)
     .execute(client)
 )
examples/tokens/token_reject_transaction_nft.py (1)

57-62: Critical: Missing freeze_with(client) violates transaction lifecycle.

The transaction skips freeze_with(client) before execute(client). Per SDK requirements, the lifecycle must be: construction → freeze_with → sign → execute.

🔎 Proposed fix
 receipt = (
     AccountCreateTransaction()
     .set_key_without_alias(new_account_public_key)
     .set_initial_balance(Hbar(1))
+    .freeze_with(client)
     .execute(client)
 )
tests/unit/account_create_transaction_test.py (1)

188-193: Fix syntax error - mismatched parentheses.

Line 192 has an extra closing parenthesis that will cause a syntax error.

🔎 Proposed fix
     account_tx = (
         AccountCreateTransaction()
         .set_key_without_alias(new_public_key)
         .set_initial_balance(100000000)
-        .set_account_memo("Test account"))
+        .set_account_memo("Test account")
     )
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 56ef986 and 2a2e33d.

📒 Files selected for processing (53)
  • CHANGELOG.md
  • docs/sdk_users/running_examples.md
  • examples/account/account_allowance_approve_transaction_hbar.py
  • examples/account/account_allowance_approve_transaction_nft.py
  • examples/account/account_allowance_delete_transaction_hbar.py
  • examples/account/account_allowance_delete_transaction_nft.py
  • examples/account/account_create_transaction.py
  • examples/account/account_delete_transaction.py
  • examples/account/account_records_query.py
  • examples/account/account_update_transaction.py
  • examples/consensus/topic_create_transaction_revenue_generating.py
  • examples/logger/logging_example.py
  • examples/query/account_balance_query_2.py
  • examples/query/account_info_query.py
  • examples/query/transaction_get_receipt_query.py
  • examples/query/transaction_record_query.py
  • examples/schedule/schedule_create_transaction.py
  • examples/schedule/schedule_delete_transaction.py
  • examples/schedule/schedule_info_query.py
  • examples/schedule/schedule_sign_transaction.py
  • examples/tokens/account_allowance_approve_transaction.py
  • examples/tokens/token_airdrop_claim_auto.py
  • examples/tokens/token_airdrop_claim_signature_required.py
  • examples/tokens/token_airdrop_transaction.py
  • examples/tokens/token_airdrop_transaction_cancel.py
  • examples/tokens/token_associate_transaction.py
  • examples/tokens/token_create_transaction_freeze_key.py
  • examples/tokens/token_create_transaction_kyc_key.py
  • examples/tokens/token_create_transaction_max_automatic_token_associations_0.py
  • examples/tokens/token_create_transaction_pause_key.py
  • examples/tokens/token_create_transaction_wipe_key.py
  • examples/tokens/token_dissociate_transaction.py
  • examples/tokens/token_grant_kyc_transaction.py
  • examples/tokens/token_reject_transaction_fungible_token.py
  • examples/tokens/token_reject_transaction_nft.py
  • examples/tokens/token_revoke_kyc_transaction.py
  • examples/tokens/token_wipe_transaction.py
  • examples/transaction/transfer_transaction_fungible.py
  • examples/transaction/transfer_transaction_hbar.py
  • examples/transaction/transfer_transaction_nft.py
  • tests/integration/account_info_query_e2e_test.py
  • tests/integration/account_update_transaction_e2e_test.py
  • tests/integration/batch_transaction_e2e_test.py
  • tests/integration/query_e2e_test.py
  • tests/integration/revenue_generating_topics_e2e_test.py
  • tests/integration/token_grant_kyc_transaction_e2e_test.py
  • tests/integration/token_reject_transaction_e2e_test.py
  • tests/integration/token_revoke_kyc_transaction_e2e_test.py
  • tests/integration/token_update_transaction_e2e_test.py
  • tests/integration/transaction_record_query_e2e_test.py
  • tests/integration/utils.py
  • tests/unit/account_create_transaction_test.py
  • tests/unit/executable_test.py
🧰 Additional context used
📓 Path-based instructions (5)
tests/integration/**/*

⚙️ CodeRabbit configuration file

tests/integration/**/*: You are acting as a senior maintainer reviewing integration tests for the hiero-sdk-python project. Your goal is to ensure end-to-end tests validate real network behavior safely and deterministically.

CRITICAL PRINCIPLES - Safety & Diagnosability:

  • Prioritize safety: No implicit or default mainnet usage.
  • Secrets and credentials must be injected safely (env vars, not hardcoded).
  • Test failures must be diagnosable with clear error messages.
  • Tests must assert observable network behavior, not just SUCCESS.
  • Failure-path tests must assert specific ResponseCode values (e.g., TOKEN_HAS_NO_PAUSE_KEY).

PRIORITY 1 - End-to-End Behavior:

  • Tests should be end-to-end: construct → freeze → sign → execute → verify.
  • Validate resulting balances, ownership, and state changes (not just transaction success).
  • Assert transaction receipts contain expected data (IDs, serial numbers, etc.).
  • Verify network state after operations (e.g., account balance changed, token transferred).

PRIORITY 2 - Test Structure & Maintainability:

  • One major behavior per test (clear focus).
  • Tests should be readable: clear names, brief docstrings, key inline comments.
  • Minimal abstraction layers - prefer clarity over DRY.
  • Is the file too monolithic? Flag if tests should be split into smaller modules.
  • Are helper functions good candidates for pytest fixtures or shared utilities?

PRIORITY 3 - Isolation & Cleanup:

  • Local account creation over operator reuse (avoid state pollution).
  • Are accounts, tokens, and allowances properly cleaned up to avoid state leakage?
  • Recommend teardown strategies or fixture scoping improvements.
  • Tests should not depend on execution order (avoid brittle assumptions).

PRIORITY 4 - Assertions & Coverage:

  • Do tests validate only success/failure, or also assert resulting state?
  • Suggest additional assertions that would strengthen correctness (balances, allowances, ownership).
  • Cover happy paths AND ...

Files:

  • tests/integration/token_revoke_kyc_transaction_e2e_test.py
  • tests/integration/transaction_record_query_e2e_test.py
  • tests/integration/token_reject_transaction_e2e_test.py
  • tests/integration/token_update_transaction_e2e_test.py
  • tests/integration/query_e2e_test.py
  • tests/integration/batch_transaction_e2e_test.py
  • tests/integration/account_update_transaction_e2e_test.py
  • tests/integration/utils.py
  • tests/integration/revenue_generating_topics_e2e_test.py
  • tests/integration/token_grant_kyc_transaction_e2e_test.py
  • tests/integration/account_info_query_e2e_test.py
examples/**/*

⚙️ CodeRabbit configuration file

examples/**/*: You are acting as a senior maintainer reviewing SDK examples. Your goal is to ensure examples work verbatim for users who copy-paste them.

Priority 1 - Correctness:

  • Verify transaction lifecycle chain (construction -> freeze_with -> sign -> execute).
  • Ensure freeze_with(client) is called BEFORE signing.
  • Validate that methods referenced actually exist in the hiero_sdk_python codebase.
  • Ensure response validation checks receipt.status against ResponseCode enums (e.g., ResponseCode.SUCCESS).

Priority 2 - Transaction Lifecycle:

  • Check method chaining logic.
  • Verify correct signing order (especially for multi-sig).
  • Ensure explicit .execute(client) calls.
  • Verify response property extraction (e.g., using .token_id, .account_id, .serial_numbers).
  • Ensure error handling uses ResponseCode(receipt.status).name for clarity.

Priority 3 - Naming & Clarity:

  • Enforce role-based naming: operator_id/_key, treasury_account_id/_key, receiver_id/_key.
  • Use _id suffix for AccountId and _key suffix for PrivateKey variables.
  • Validate negative examples explicitly check for failure codes (e.g., TOKEN_HAS_NO_PAUSE_KEY).
  • Ensure logical top-to-bottom flow without ambiguity.

Priority 4 - Consistency:

  • Verify standard patterns: def main(), if __name__ == "__main__":, load_dotenv().
  • IMPORT RULES:
    1. Accept both top-level imports (e.g., from hiero_sdk_python import PrivateKey) and fully qualified imports (e.g., from hiero_sdk_python.crypto.private_key import PrivateKey).
    2. STRICTLY validate that the import path actually exists in the project structure. Compare against other files in /examples or your knowledge of the SDK file tree.
    3. Flag hallucinations immediately (e.g., hiero_sdk_python.keys does not exist).
  • Check for try-except blocks with sys.exit(1) for critical failures.

Priority 5 - User Experience:

  • Ensure comments explain SDK usage patterns (for users,...

Files:

  • examples/transaction/transfer_transaction_nft.py
  • examples/account/account_allowance_approve_transaction_nft.py
  • examples/schedule/schedule_create_transaction.py
  • examples/logger/logging_example.py
  • examples/tokens/token_create_transaction_wipe_key.py
  • examples/tokens/token_airdrop_transaction_cancel.py
  • examples/account/account_allowance_delete_transaction_nft.py
  • examples/tokens/token_create_transaction_pause_key.py
  • examples/consensus/topic_create_transaction_revenue_generating.py
  • examples/account/account_create_transaction.py
  • examples/account/account_allowance_delete_transaction_hbar.py
  • examples/account/account_update_transaction.py
  • examples/tokens/token_create_transaction_freeze_key.py
  • examples/schedule/schedule_sign_transaction.py
  • examples/query/account_balance_query_2.py
  • examples/account/account_delete_transaction.py
  • examples/account/account_allowance_approve_transaction_hbar.py
  • examples/schedule/schedule_info_query.py
  • examples/tokens/token_airdrop_claim_auto.py
  • examples/tokens/token_grant_kyc_transaction.py
  • examples/account/account_records_query.py
  • examples/tokens/token_airdrop_transaction.py
  • examples/query/account_info_query.py
  • examples/tokens/token_airdrop_claim_signature_required.py
  • examples/tokens/token_create_transaction_kyc_key.py
  • examples/tokens/token_wipe_transaction.py
  • examples/tokens/token_revoke_kyc_transaction.py
  • examples/tokens/token_reject_transaction_nft.py
  • examples/query/transaction_record_query.py
  • examples/tokens/token_associate_transaction.py
  • examples/transaction/transfer_transaction_fungible.py
  • examples/schedule/schedule_delete_transaction.py
  • examples/query/transaction_get_receipt_query.py
  • examples/transaction/transfer_transaction_hbar.py
  • examples/tokens/token_reject_transaction_fungible_token.py
  • examples/tokens/token_dissociate_transaction.py
  • examples/tokens/account_allowance_approve_transaction.py
  • examples/tokens/token_create_transaction_max_automatic_token_associations_0.py
tests/unit/**/*

⚙️ CodeRabbit configuration file

tests/unit/**/*: You are acting as a senior maintainer reviewing unit tests for the hiero-sdk-python project. Your goal is to ensure tests are extensive, deterministic, and protect against breaking changes.

CRITICAL PRINCIPLES - Tests Must Fail Loudly & Deterministically:

  • Tests must provide useful error messages when they fail for future debugging.
  • No print() statements - use assertions with descriptive messages.
  • No timing-dependent or unseeded random assertions.
  • No network calls or external dependencies (unit tests are isolated).
  • No unjustified TODOs or skipped tests without tracking issues.

PRIORITY 1 - Protect Against Breaking Changes:

  • Assert public attributes exist (e.g., assert hasattr(obj, 'account_id')).
  • Assert return types where relevant (e.g., assert isinstance(result, AccountId)).
  • Assert fluent setters return self (e.g., assert tx.set_memo("test") is tx).
  • Assert backward-compatible defaults are maintained.
  • If a breaking change is introduced, tests must assert deprecation behavior and test old behavior until removal.

PRIORITY 2 - Constructor & Setter Behavior:

  • Test constructor behavior with valid inputs, edge cases, and invalid inputs.
  • Test setter behavior including method chaining (fluent interface).
  • Verify that setters validate input and raise appropriate exceptions.
  • Test that getters return expected values after construction/setting.

PRIORITY 3 - Comprehensive Coverage:

  • Unit tests should be extensive - test even if we don't expect users to use it currently.
  • Cover happy paths AND unhappy paths/edge cases.
  • Test boundary conditions, null/None values, empty collections, etc.
  • Avoid brittle ordering assertions unless order is part of the contract.

PRIORITY 4 - No Mocks for Non-Existent Modules:

  • All imports must reference actual SDK modules - no hallucinated paths.
  • Validate import paths against the actual src/hiero_sdk_python structure.
  • Mocks should only be used for external de...

Files:

  • tests/unit/account_create_transaction_test.py
  • tests/unit/executable_test.py
docs/**

⚙️ CodeRabbit configuration file

docs/**: You are reviewing documentation for the Hiero Python SDK. These pages serve both SDK users and SDK developers.

Priority 1 - Correctness (code, commands, links)

  1. Verify code snippets conceptually run and match the current SDK API.
  2. Check shell commands and workflow steps against actual project tooling.
  3. Validate URLs and cross-references; flag broken or misleading links.

Priority 2 - Clarity and completeness

  1. Ensure each page states its purpose and expected outcome early.
  2. Prefer concrete, step-wise explanations over vague descriptions.
  3. Highlight missing prerequisites that would block a reader.
  4. For larger gaps, suggest filing a follow-up issue instead of blocking.

Priority 3 - Consistency and navigation

  1. Encourage consistent terminology with the SDK and examples.
  2. Check headings form a logical reading path.
  3. Confirm each page makes clear which audience it serves.

PHILOSOPHY

  • Treat docs as work-in-progress: optimize for correctness and clarity over perfection.
  • Keep feedback concise, action-oriented, and focused on reader success.
  • Do not request large-scale restructures unless current structure blocks understanding.

AVOID

  • Avoid lint-style feedback on Markdown formatting or minor wording.
  • Avoid proposing new conventions without clear benefit.
  • Avoid turning every high-level gap into a blocker.

Files:

  • docs/sdk_users/running_examples.md
docs/sdk_users/**

⚙️ CodeRabbit configuration file

docs/sdk_users/**: These documents are for SDK users who want to USE the Hiero Python SDK quickly and correctly.

Priority 1 - High-level guidance

  1. Ensure explanations are conceptual and point to /examples for runnable code.
  2. Check that required environment variables and network choices are clearly stated.

Priority 2 - No hidden assumptions

  1. Assume zero prior knowledge of this SDK and minimal Hedera background.
  2. Avoid requiring knowledge of repository layout or contribution workflow.

PHILOSOPHY

  • Keep explanations high-level and conceptual; defer runnable examples to /examples.
  • Focus on what users need to know before diving into code examples.

Files:

  • docs/sdk_users/running_examples.md
🧬 Code graph analysis (51)
tests/integration/token_revoke_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/transaction/transfer_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_allowance_approve_transaction_nft.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/schedule/schedule_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/logger/logging_example.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/integration/transaction_record_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_create_transaction_wipe_key.py (3)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/unit/conftest.py (1)
  • private_key (54-56)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_airdrop_transaction_cancel.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/account/account_allowance_delete_transaction_nft.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_create_transaction_pause_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/token_reject_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (2)
  • set_key_without_alias (94-107)
  • AccountCreateTransaction (27-380)
tests/unit/account_create_transaction_test.py (1)
src/hiero_sdk_python/crypto/private_key.py (2)
  • public_key (305-309)
  • PrivateKey (14-471)
examples/consensus/topic_create_transaction_revenue_generating.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_allowance_delete_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/token_update_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/account/account_update_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_create_transaction_freeze_key.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/integration/query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/schedule/schedule_sign_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/query/account_balance_query_2.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/batch_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (2)
  • set_key_without_alias (94-107)
  • AccountCreateTransaction (27-380)
src/hiero_sdk_python/transaction/transaction.py (1)
  • batchify (825-840)
examples/account/account_allowance_approve_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/schedule/schedule_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/account_update_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_airdrop_claim_auto.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_grant_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/utils.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/account/account_records_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_airdrop_transaction.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/query/account_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_airdrop_claim_signature_required.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_create_transaction_kyc_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_wipe_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/revenue_generating_topics_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/integration/token_grant_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/account_info_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_revoke_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_reject_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/query/transaction_record_query.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_associate_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/transaction/transfer_transaction_fungible.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/schedule/schedule_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/query/transaction_get_receipt_query.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/transaction/transfer_transaction_hbar.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_reject_transaction_fungible_token.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_dissociate_transaction.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/account_allowance_approve_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_create_transaction_max_automatic_token_associations_0.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/unit/executable_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (58)
examples/tokens/token_airdrop_claim_signature_required.py (1)

101-101: LGTM! Correct replacement of deprecated method.

The migration from set_key() to set_key_without_alias() is correct. The method accepts the PublicKey parameter, and the transaction lifecycle (freeze → sign → execute) remains properly sequenced.

examples/query/transaction_get_receipt_query.py (5)

11-21: LGTM: Imports are correct.

All imports follow the top-level pattern (allowed per guidelines) and reference valid SDK classes.


27-42: LGTM: Client setup follows standard pattern.

Proper error handling, role-based naming (operator_id, operator_key), and clear error messages for users.


45-62: LGTM: Correct replacement of deprecated API.

The change from .set_key() to .set_key_without_alias() is correct:

  • Method exists per account_create_transaction.py (lines 93-106).
  • Accepts PublicKey derived from recipient_key.public_key().
  • Transaction lifecycle is correct: freeze_with(client)sign(operator_key)execute(client).
  • Response property extraction (receipt.account_id) is appropriate.

This aligns with the PR objective to replace deprecated set_key() usage.


101-144: LGTM: Query example demonstrates correct SDK patterns.

  • Transfer transaction lifecycle is correct (freeze → sign → execute).
  • Receipt querying with set_include_children() and set_include_duplicates() demonstrates SDK capabilities effectively.
  • ResponseCode usage is appropriate for status display.

147-148: LGTM: Standard main block pattern.

examples/tokens/token_wipe_transaction.py (1)

55-55: LGTM! Deprecated method correctly replaced.

The replacement of set_key() with set_key_without_alias() is correct and aligns with the SDK's updated API. The method is properly chained within the transaction lifecycle, and the public key parameter is appropriate.

CHANGELOG.md (1)

136-137: LGTM! Clear documentation of the API change.

The CHANGELOG entry accurately describes the replacement of deprecated set_key() with set_key_without_alias() and set_key_with_alias() across examples and tests.

examples/query/account_info_query.py (1)

55-63: LGTM! Correct usage of set_key_without_alias.

The transaction lifecycle is correct:

  • freeze_with(client)sign(operator_key)execute(client)

The method call properly uses the public key and follows SDK best practices.

examples/logger/logging_example.py (1)

110-116: LGTM! Proper usage of set_key_without_alias.

The transaction correctly:

  • Uses set_key_without_alias(new_key.public_key()) for account creation
  • Follows proper transaction lifecycle: freeze_withsignexecute
examples/tokens/token_associate_transaction.py (1)

76-84: LGTM! Correct implementation of set_key_without_alias.

The account creation transaction follows the proper lifecycle:

  • freeze_with(client)sign(operator_key)execute(client)

The change aligns with current SDK best practices for account key setup.

examples/transaction/transfer_transaction_nft.py (1)

57-63: LGTM! Proper usage of set_key_without_alias.

The transaction correctly:

  • Uses set_key_without_alias(new_account_public_key) for account creation
  • Follows transaction lifecycle: freeze_with(client)execute(client)

The change aligns with the SDK's updated key-setting API.

examples/tokens/account_allowance_approve_transaction.py (1)

53-53: LGTM: Deprecated API correctly replaced.

The change from set_key() to set_key_without_alias() aligns with the SDK's updated API. The method accepts the public key correctly and maintains proper method chaining.

examples/transaction/transfer_transaction_fungible.py (1)

59-59: LGTM: Correct API migration.

The replacement of set_key() with set_key_without_alias() is correct. The transaction lifecycle is properly maintained with freeze_with → sign → execute, and the public key is correctly derived from the generated private key.

examples/tokens/token_airdrop_transaction_cancel.py (1)

58-58: LGTM: API update applied correctly.

The change from set_key() to set_key_without_alias() is correct and follows the proper transaction lifecycle pattern with freeze_with → sign → execute.

examples/account/account_allowance_approve_transaction_nft.py (1)

86-86: LGTM: Deprecated method replaced correctly.

The migration from set_key() to set_key_without_alias() is correct. The account creation flow properly validates the response status and handles errors appropriately.

tests/integration/token_grant_kyc_transaction_e2e_test.py (1)

22-22: LGTM: Integration tests updated correctly.

All three occurrences of the deprecated set_key() method have been correctly replaced with set_key_without_alias(). The test account creation flows properly validate response status and maintain the expected integration test patterns.

Also applies to: 65-65, 119-119

examples/account/account_records_query.py (1)

48-55: LGTM! Correct transaction lifecycle.

The replacement of set_key() with set_key_without_alias() aligns with SDK deprecation. Transaction properly follows: construction → freeze_with → execute.

examples/tokens/token_create_transaction_freeze_key.py (1)

181-188: LGTM! Correct transaction lifecycle with signing.

The replacement of set_key() with set_key_without_alias() aligns with SDK deprecation. Transaction properly follows: construction → freeze_with → sign → execute.

examples/schedule/schedule_delete_transaction.py (1)

51-59: LGTM! Correct transaction lifecycle with signing.

The replacement of set_key() with set_key_without_alias() aligns with SDK deprecation. Transaction properly follows: construction → freeze_with → sign → execute.

examples/tokens/token_airdrop_claim_auto.py (1)

90-99: LGTM! Correct lifecycle pattern.

The method change to set_key_without_alias() is correct, and the transaction properly follows the complete lifecycle: construction → freeze_with → sign → execute.

examples/transaction/transfer_transaction_hbar.py (1)

54-59: LGTM! Correct lifecycle pattern.

The method change to set_key_without_alias() is correct, and the transaction properly follows the complete lifecycle: construction → freeze_with → sign → execute.

tests/integration/revenue_generating_topics_e2e_test.py (2)

529-534: LGTM! Correct migration to set_key_without_alias.

The account creation correctly uses set_key_without_alias() to associate the fee exempt key without alias handling, aligning with the API migration.


592-597: LGTM! Consistent API usage.

The account creation properly uses set_key_without_alias(), consistent with the pattern established elsewhere in this test suite.

tests/integration/account_update_transaction_e2e_test.py (5)

27-33: LGTM! Correct API migration.

Account creation properly uses set_key_without_alias() instead of the deprecated set_key().


102-107: LGTM! Consistent with API migration.

Correctly uses set_key_without_alias() for account creation with the initial public key.


140-147: LGTM! Proper API usage.

Account creation correctly migrated to set_key_without_alias().


339-344: LGTM! Correct migration.

Properly uses set_key_without_alias() for account creation in the staking test.


349-354: LGTM! Consistent API usage.

Account creation correctly uses set_key_without_alias().

examples/tokens/token_grant_kyc_transaction.py (1)

106-111: LGTM! Correct API migration.

The account creation transaction correctly uses set_key_without_alias() and follows the proper transaction lifecycle: construction → freeze_withexecute.

examples/account/account_update_transaction.py (1)

45-53: LGTM! Proper API migration.

Account creation correctly uses set_key_without_alias() and demonstrates the complete transaction lifecycle with proper signing.

examples/account/account_delete_transaction.py (1)

25-33: LGTM! Correct migration.

Account creation properly uses set_key_without_alias() and follows the complete transaction lifecycle pattern.

examples/schedule/schedule_info_query.py (1)

52-52: Correct replacement of deprecated method.

The change from set_key() to set_key_without_alias() is correct and maintains the transaction lifecycle. The method properly accepts the public key and preserves method chaining.

examples/schedule/schedule_create_transaction.py (1)

48-48: Correct replacement of deprecated method.

The change from set_key() to set_key_without_alias() correctly updates the account creation flow. The transaction lifecycle remains intact with proper freeze → sign → execute ordering.

examples/tokens/token_create_transaction_pause_key.py (1)

197-197: Correct replacement of deprecated method.

The change to set_key_without_alias() is correct and aligns with the inline comment emphasizing public key usage. The transaction lifecycle is properly maintained.

tests/integration/query_e2e_test.py (1)

25-25: Correct replacement of deprecated method across all test functions.

All five occurrences correctly replace set_key() with set_key_without_alias(). The changes maintain the existing transaction patterns and don't alter test behavior.

Also applies to: 75-75, 132-132, 171-171, 217-217

tests/integration/token_revoke_kyc_transaction_e2e_test.py (1)

23-23: Correct replacement of deprecated method across all test functions.

All three occurrences correctly replace set_key() with set_key_without_alias(). The changes are consistent with the account creation pattern and don't alter the test behavior or lifecycle.

Also applies to: 75-75, 127-127

tests/integration/batch_transaction_e2e_test.py (2)

17-26: LGTM: Helper function correctly uses set_key_without_alias.

The helper correctly uses the new set_key_without_alias API. Note that this transaction doesn't call freeze_with explicitly because it's a simple account creation without signing requirements beyond the operator signature (implicitly handled during execution).


280-301: LGTM: Test correctly uses set_key_without_alias in batch context.

All three AccountCreateTransaction instances correctly use set_key_without_alias. The batchify() method internally handles freeze_with and signing, so the transaction lifecycle is correct for batch transactions.

examples/account/account_create_transaction.py (1)

76-85: LGTM: Correct API usage and transaction lifecycle.

The example correctly demonstrates:

  • Using set_key_without_alias for the new non-deprecated API
  • Proper transaction lifecycle: freeze_with(client).sign(operator_key).execute(client)

This is a good reference for users copying example code.

docs/sdk_users/running_examples.md (1)

123-123: Documentation correctly updated to reflect current API.

The change from set_key() to set_key_without_alias() aligns with the SDK's deprecation of the former method. Users following this documentation will now use the recommended API.

examples/account/account_allowance_delete_transaction_nft.py (1)

71-77: Correct API migration in account creation.

The replacement of set_key() with set_key_without_alias() properly updates this example to use the non-deprecated method. The transaction lifecycle and method chaining are correct.

examples/tokens/token_create_transaction_kyc_key.py (1)

92-99: API update correctly applied with proper transaction lifecycle.

The change to set_key_without_alias() is correct, and the transaction properly follows the freeze_with → sign → execute pattern as required by the SDK.

tests/integration/token_reject_transaction_e2e_test.py (4)

115-117: Integration test correctly updated to use current API.

The migration from set_key() to set_key_without_alias() ensures this integration test uses the recommended SDK method. The transaction chain and assertions remain valid.


177-177: Correct API update in test.

The change to set_key_without_alias() properly updates this test to use the non-deprecated method.


883-885: Treasury account creation correctly updated.

The API migration to set_key_without_alias() is correct and maintains the test's integrity for validating receiver signature requirements.


903-903: Receiver account creation correctly updated.

The change to set_key_without_alias() properly updates the test to use the current API.

examples/schedule/schedule_sign_transaction.py (1)

57-65: Example correctly updated with proper transaction flow.

The replacement of set_key() with set_key_without_alias() updates this example to current SDK best practices. The transaction lifecycle (freeze_with → sign → execute) is correctly implemented.

examples/account/account_allowance_approve_transaction_hbar.py (1)

70-70: LGTM! Correct migration from deprecated method.

The replacement of set_key() with set_key_without_alias() is correct and maintains the fluent interface. The transaction lifecycle (construction → execute) is appropriate for operator-signed transactions.

examples/tokens/token_airdrop_transaction.py (1)

59-59: LGTM! Correct migration with proper transaction lifecycle.

The replacement of set_key() with set_key_without_alias() is correct. The transaction follows the proper lifecycle: construction → freeze_with → sign → execute.

tests/unit/executable_test.py (1)

55-55: LGTM! Consistent migration across all test cases.

All occurrences correctly replace set_key() with set_key_without_alias() while preserving the test logic and fluent interface. The tests continue to properly validate retry behavior, node switching, and error handling.

Also applies to: 78-78, 118-118, 155-155, 191-191, 222-222, 256-256, 294-294, 410-410

examples/query/transaction_record_query.py (1)

57-57: LGTM! Correct migration from deprecated method.

The replacement of set_key() with set_key_without_alias() is correct and maintains proper method chaining. The operator-implicit execution pattern is appropriate here.

tests/integration/transaction_record_query_e2e_test.py (1)

25-25: LGTM! Correct migration in integration test.

The replacement of set_key() with set_key_without_alias() is correct and maintains the test's end-to-end validation of transaction record queries. The transaction lifecycle and assertions remain appropriate.

examples/account/account_allowance_delete_transaction_hbar.py (1)

43-43: LGTM: Correct usage of set_key_without_alias.

The replacement of deprecated set_key() with set_key_without_alias() is correct and aligns with the updated SDK API.

examples/tokens/token_create_transaction_max_automatic_token_associations_0.py (1)

95-95: LGTM: Correct usage of set_key_without_alias with proper transaction lifecycle.

The replacement of deprecated set_key() with set_key_without_alias() is correct. The transaction properly follows the lifecycle: construction → freeze_with(client)sign(operator_key)execute(client).

tests/unit/account_create_transaction_test.py (2)

45-45: LGTM: Test coverage properly updated for set_key_without_alias.

The test suite correctly exercises the new set_key_without_alias method across multiple scenarios:

  • Basic transaction building
  • Scheduled transaction bodies
  • Transaction signing
  • Integration with mock servers
  • Validation edge cases

Tests verify both the fluent interface and that the alias field is properly set to None when using set_key_without_alias.

Also applies to: 70-70, 105-105, 170-170, 190-190, 237-237


267-286: LGTM: Comprehensive test coverage for set_key_with_alias functionality.

The test suite thoroughly covers the new set_key_with_alias method:

  • Alias derivation from ECDSA public keys
  • Separate keys for account and alias
  • Error handling for non-ECDSA keys
  • Support for both PublicKey and PrivateKey inputs
  • Interaction between set_key_with_alias and set_key_without_alias (mutual override behavior)

Tests protect against breaking changes by verifying attribute existence, return types, and fluent interface behavior.

Also applies to: 287-307, 308-324, 425-453, 456-481, 483-503, 505-525

examples/tokens/token_revoke_kyc_transaction.py (1)

111-111: LGTM! Correct replacement of deprecated method.

The change from .set_key() to .set_key_without_alias() is the appropriate replacement for the deprecated method. This aligns with the PR objective and SDK best practices. The transaction lifecycle is correct (freeze_with before execute), and no alias is used in this example, making set_key_without_alias the right choice.

@prishajaiswal75 prishajaiswal75 force-pushed the fix/deprecate-set-key-clean branch from 2a2e33d to cee082e Compare January 4, 2026 23:04
@prishajaiswal75
Copy link
Contributor Author

Yes, so, well done! you have solved the issue However, we need certain things for your PR to qualify to be able to be merged, solving the issue is just one of them. Additionally, we need your commits to be signed correctly (git commit -S -s -m "..."), so this needs both a DCO and GPG sign.

Once that's done, that check will pass :) Screenshot 2026-01-04 at 22 52 56

You can read our signing.md guide

Oh i had forgotten about GCP was only focussing on DCO sorry

@prishajaiswal75
Copy link
Contributor Author

Thank you also thank you for taking my health and delay into consideration

@prishajaiswal75
Copy link
Contributor Author

also i had a doubt regarding the coderabbit comments about freeze why are they occuring ?

@exploreriii
Copy link
Contributor

Congratulations with the signing!
Don't worry about the freeze in this case, code rabbit isn't understanding subtlety
we usually freeze transactions to explicitly illustrate things in examples, but its not required as is covered by execute anyway

@prishajaiswal75
Copy link
Contributor Author

prishajaiswal75 commented Jan 5, 2026 via email

@exploreriii exploreriii marked this pull request as draft January 5, 2026 09:30
Copy link
Contributor

@exploreriii exploreriii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Please fix this outstanding syntax error
.set_account_memo("Test account"))

Thank you so much

@prishajaiswal75
Copy link
Contributor Author

prishajaiswal75 commented Jan 6, 2026 via email

@prishajaiswal75 prishajaiswal75 marked this pull request as ready for review January 6, 2026 18:39
@exploreriii
Copy link
Contributor

exploreriii commented Jan 6, 2026

If anyone is available to help see why the unit tests have failed, is there a change in this PR or do we have a general bug? @hiero-ledger/hiero-sdk-python-triage
https://github.com/hiero-ledger/hiero-sdk-python/actions/runs/20758275496/job/59606244655?pr=1355

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (8)
tests/integration/account_update_transaction_e2e_test.py (4)

186-186: Replace deprecated set_key() with set_key_without_alias().

This line still uses the deprecated set_key() method. For consistency with the PR objective and the rest of this file (lines 28, 104, 142, 341, 351), this should be updated to set_key_without_alias().

🔎 Proposed fix
-        .set_key(env.operator_key.public_key())
+        .set_key_without_alias(env.operator_key.public_key())

238-238: Replace deprecated set_key() with set_key_without_alias().

This line still uses the deprecated set_key() method. For consistency with the PR objective, update to set_key_without_alias().

🔎 Proposed fix
-        .set_key(env.operator_key.public_key())
+        .set_key_without_alias(env.operator_key.public_key())

276-276: Replace deprecated set_key() with set_key_without_alias().

This line still uses the deprecated set_key() method. For consistency with the PR objective, update to set_key_without_alias().

🔎 Proposed fix
-        .set_key(env.operator_key.public_key())
+        .set_key_without_alias(env.operator_key.public_key())

383-383: Replace deprecated set_key() with set_key_without_alias().

This line still uses the deprecated set_key() method. For consistency with the PR objective, update to set_key_without_alias().

🔎 Proposed fix
-        .set_key(env.operator_key.public_key())
+        .set_key_without_alias(env.operator_key.public_key())
examples/tokens/account_allowance_approve_transaction.py (1)

51-57: Fix syntax error: extra closing parenthesis.

Line 55 has an extra closing parenthesis after .set_account_memo("Test account")) which causes a syntax error. This was flagged by @exploreriii in the PR comments and must be fixed before merge.

🔎 Proposed fix
     account_receipt = (
         AccountCreateTransaction()
         .set_key_without_alias(account_public_key)
         .set_initial_balance(Hbar(1))
-        .set_account_memo("Test account"))
+        .set_account_memo("Test account")
         .execute(client)
     )

Note: The set_key_without_alias() change on line 53 is correct.

tests/unit/account_create_transaction_test.py (3)

326-346: Critical: Incorrect method usage will cause test to fail.

Line 334 calls set_key_with_alias() with a non-ECDSA key (ED25519), which will raise a ValueError at runtime. The public_key on line 329 is generated using PrivateKey.generate(), which defaults to ED25519, not ECDSA. According to the implementation in account_create_transaction.py, set_key_with_alias() attempts to derive an EVM address from the key, which requires an ECDSA key.

Since this test is validating the set_alias() method (line 335) and manually provides the EVM address, use set_key_without_alias() instead.

🔎 Proposed fix
     tx = (
         AccountCreateTransaction()
-        .set_key_with_alias(public_key)
+        .set_key_without_alias(public_key)
         .set_alias(evm_address)
     )

348-372: Critical: Incorrect method usage will cause test to fail.

Line 360 has the same issue as the previous test. It calls set_key_with_alias() with a non-ECDSA key (line 352 generates an ED25519 key), which will raise a ValueError. This test validates set_alias() with string input, so use set_key_without_alias() instead.

🔎 Proposed fix
     tx = (
         AccountCreateTransaction()
-        .set_key_with_alias(public_key)
+        .set_key_without_alias(public_key)
         .set_alias(alias_str)
     )

248-258: Consider adding fluent interface assertions.

While the tests use method chaining, they don't explicitly verify that setters return self. Per the coding guidelines (PRIORITY 2), tests should assert that fluent setters return self to protect against breaking changes.

Consider adding assertions like:

assert tx.set_key_without_alias(public_key) is tx

This can be added to existing tests or as a dedicated test. Based on learnings, testing the fluent interface contract is important for SDK maintainability.

As per coding guidelines, tests should protect against breaking changes to the fluent interface pattern.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2a2e33d and eaa39d9.

📒 Files selected for processing (53)
  • CHANGELOG.md
  • docs/sdk_users/running_examples.md
  • examples/account/account_allowance_approve_transaction_hbar.py
  • examples/account/account_allowance_approve_transaction_nft.py
  • examples/account/account_allowance_delete_transaction_hbar.py
  • examples/account/account_allowance_delete_transaction_nft.py
  • examples/account/account_create_transaction.py
  • examples/account/account_delete_transaction.py
  • examples/account/account_records_query.py
  • examples/account/account_update_transaction.py
  • examples/consensus/topic_create_transaction_revenue_generating.py
  • examples/logger/logging_example.py
  • examples/query/account_balance_query_2.py
  • examples/query/account_info_query.py
  • examples/query/transaction_get_receipt_query.py
  • examples/query/transaction_record_query.py
  • examples/schedule/schedule_create_transaction.py
  • examples/schedule/schedule_delete_transaction.py
  • examples/schedule/schedule_info_query.py
  • examples/schedule/schedule_sign_transaction.py
  • examples/tokens/account_allowance_approve_transaction.py
  • examples/tokens/token_airdrop_claim_auto.py
  • examples/tokens/token_airdrop_claim_signature_required.py
  • examples/tokens/token_airdrop_transaction.py
  • examples/tokens/token_airdrop_transaction_cancel.py
  • examples/tokens/token_associate_transaction.py
  • examples/tokens/token_create_transaction_freeze_key.py
  • examples/tokens/token_create_transaction_kyc_key.py
  • examples/tokens/token_create_transaction_max_automatic_token_associations_0.py
  • examples/tokens/token_create_transaction_pause_key.py
  • examples/tokens/token_create_transaction_wipe_key.py
  • examples/tokens/token_dissociate_transaction.py
  • examples/tokens/token_grant_kyc_transaction.py
  • examples/tokens/token_reject_transaction_fungible_token.py
  • examples/tokens/token_reject_transaction_nft.py
  • examples/tokens/token_revoke_kyc_transaction.py
  • examples/tokens/token_wipe_transaction.py
  • examples/transaction/transfer_transaction_fungible.py
  • examples/transaction/transfer_transaction_hbar.py
  • examples/transaction/transfer_transaction_nft.py
  • tests/integration/account_info_query_e2e_test.py
  • tests/integration/account_update_transaction_e2e_test.py
  • tests/integration/batch_transaction_e2e_test.py
  • tests/integration/query_e2e_test.py
  • tests/integration/revenue_generating_topics_e2e_test.py
  • tests/integration/token_grant_kyc_transaction_e2e_test.py
  • tests/integration/token_reject_transaction_e2e_test.py
  • tests/integration/token_revoke_kyc_transaction_e2e_test.py
  • tests/integration/token_update_transaction_e2e_test.py
  • tests/integration/transaction_record_query_e2e_test.py
  • tests/integration/utils.py
  • tests/unit/account_create_transaction_test.py
  • tests/unit/executable_test.py
🧰 Additional context used
📓 Path-based instructions (5)
examples/**/*

⚙️ CodeRabbit configuration file

examples/**/*: You are acting as a senior maintainer reviewing SDK examples. Your goal is to ensure examples work verbatim for users who copy-paste them.

Priority 1 - Correctness:

  • Verify transaction lifecycle chain (construction -> freeze_with -> sign -> execute).
  • Ensure freeze_with(client) is called BEFORE signing.
  • Validate that methods referenced actually exist in the hiero_sdk_python codebase.
  • Ensure response validation checks receipt.status against ResponseCode enums (e.g., ResponseCode.SUCCESS).

Priority 2 - Transaction Lifecycle:

  • Check method chaining logic.
  • Verify correct signing order (especially for multi-sig).
  • Ensure explicit .execute(client) calls.
  • Verify response property extraction (e.g., using .token_id, .account_id, .serial_numbers).
  • Ensure error handling uses ResponseCode(receipt.status).name for clarity.

Priority 3 - Naming & Clarity:

  • Enforce role-based naming: operator_id/_key, treasury_account_id/_key, receiver_id/_key.
  • Use _id suffix for AccountId and _key suffix for PrivateKey variables.
  • Validate negative examples explicitly check for failure codes (e.g., TOKEN_HAS_NO_PAUSE_KEY).
  • Ensure logical top-to-bottom flow without ambiguity.

Priority 4 - Consistency:

  • Verify standard patterns: def main(), if __name__ == "__main__":, load_dotenv().
  • IMPORT RULES:
    1. Accept both top-level imports (e.g., from hiero_sdk_python import PrivateKey) and fully qualified imports (e.g., from hiero_sdk_python.crypto.private_key import PrivateKey).
    2. STRICTLY validate that the import path actually exists in the project structure. Compare against other files in /examples or your knowledge of the SDK file tree.
    3. Flag hallucinations immediately (e.g., hiero_sdk_python.keys does not exist).
  • Check for try-except blocks with sys.exit(1) for critical failures.

Priority 5 - User Experience:

  • Ensure comments explain SDK usage patterns (for users,...

Files:

  • examples/tokens/token_reject_transaction_fungible_token.py
  • examples/tokens/token_create_transaction_kyc_key.py
  • examples/tokens/token_wipe_transaction.py
  • examples/schedule/schedule_delete_transaction.py
  • examples/account/account_create_transaction.py
  • examples/account/account_allowance_approve_transaction_hbar.py
  • examples/transaction/transfer_transaction_fungible.py
  • examples/schedule/schedule_info_query.py
  • examples/tokens/token_airdrop_claim_auto.py
  • examples/tokens/token_create_transaction_freeze_key.py
  • examples/tokens/token_associate_transaction.py
  • examples/account/account_allowance_delete_transaction_nft.py
  • examples/query/transaction_record_query.py
  • examples/tokens/account_allowance_approve_transaction.py
  • examples/tokens/token_airdrop_transaction.py
  • examples/query/transaction_get_receipt_query.py
  • examples/tokens/token_airdrop_transaction_cancel.py
  • examples/logger/logging_example.py
  • examples/transaction/transfer_transaction_nft.py
  • examples/query/account_balance_query_2.py
  • examples/account/account_allowance_approve_transaction_nft.py
  • examples/tokens/token_create_transaction_pause_key.py
  • examples/tokens/token_airdrop_claim_signature_required.py
  • examples/account/account_delete_transaction.py
  • examples/schedule/schedule_sign_transaction.py
  • examples/consensus/topic_create_transaction_revenue_generating.py
  • examples/account/account_allowance_delete_transaction_hbar.py
  • examples/tokens/token_create_transaction_max_automatic_token_associations_0.py
  • examples/query/account_info_query.py
  • examples/transaction/transfer_transaction_hbar.py
  • examples/account/account_update_transaction.py
  • examples/tokens/token_reject_transaction_nft.py
  • examples/tokens/token_create_transaction_wipe_key.py
  • examples/tokens/token_dissociate_transaction.py
  • examples/account/account_records_query.py
  • examples/tokens/token_grant_kyc_transaction.py
  • examples/tokens/token_revoke_kyc_transaction.py
  • examples/schedule/schedule_create_transaction.py
tests/integration/**/*

⚙️ CodeRabbit configuration file

tests/integration/**/*: You are acting as a senior maintainer reviewing integration tests for the hiero-sdk-python project. Your goal is to ensure end-to-end tests validate real network behavior safely and deterministically.

CRITICAL PRINCIPLES - Safety & Diagnosability:

  • Prioritize safety: No implicit or default mainnet usage.
  • Secrets and credentials must be injected safely (env vars, not hardcoded).
  • Test failures must be diagnosable with clear error messages.
  • Tests must assert observable network behavior, not just SUCCESS.
  • Failure-path tests must assert specific ResponseCode values (e.g., TOKEN_HAS_NO_PAUSE_KEY).

PRIORITY 1 - End-to-End Behavior:

  • Tests should be end-to-end: construct → freeze → sign → execute → verify.
  • Validate resulting balances, ownership, and state changes (not just transaction success).
  • Assert transaction receipts contain expected data (IDs, serial numbers, etc.).
  • Verify network state after operations (e.g., account balance changed, token transferred).

PRIORITY 2 - Test Structure & Maintainability:

  • One major behavior per test (clear focus).
  • Tests should be readable: clear names, brief docstrings, key inline comments.
  • Minimal abstraction layers - prefer clarity over DRY.
  • Is the file too monolithic? Flag if tests should be split into smaller modules.
  • Are helper functions good candidates for pytest fixtures or shared utilities?

PRIORITY 3 - Isolation & Cleanup:

  • Local account creation over operator reuse (avoid state pollution).
  • Are accounts, tokens, and allowances properly cleaned up to avoid state leakage?
  • Recommend teardown strategies or fixture scoping improvements.
  • Tests should not depend on execution order (avoid brittle assumptions).

PRIORITY 4 - Assertions & Coverage:

  • Do tests validate only success/failure, or also assert resulting state?
  • Suggest additional assertions that would strengthen correctness (balances, allowances, ownership).
  • Cover happy paths AND ...

Files:

  • tests/integration/token_grant_kyc_transaction_e2e_test.py
  • tests/integration/token_update_transaction_e2e_test.py
  • tests/integration/batch_transaction_e2e_test.py
  • tests/integration/token_revoke_kyc_transaction_e2e_test.py
  • tests/integration/transaction_record_query_e2e_test.py
  • tests/integration/account_update_transaction_e2e_test.py
  • tests/integration/query_e2e_test.py
  • tests/integration/revenue_generating_topics_e2e_test.py
  • tests/integration/token_reject_transaction_e2e_test.py
  • tests/integration/account_info_query_e2e_test.py
  • tests/integration/utils.py
tests/unit/**/*

⚙️ CodeRabbit configuration file

tests/unit/**/*: You are acting as a senior maintainer reviewing unit tests for the hiero-sdk-python project. Your goal is to ensure tests are extensive, deterministic, and protect against breaking changes.

CRITICAL PRINCIPLES - Tests Must Fail Loudly & Deterministically:

  • Tests must provide useful error messages when they fail for future debugging.
  • No print() statements - use assertions with descriptive messages.
  • No timing-dependent or unseeded random assertions.
  • No network calls or external dependencies (unit tests are isolated).
  • No unjustified TODOs or skipped tests without tracking issues.

PRIORITY 1 - Protect Against Breaking Changes:

  • Assert public attributes exist (e.g., assert hasattr(obj, 'account_id')).
  • Assert return types where relevant (e.g., assert isinstance(result, AccountId)).
  • Assert fluent setters return self (e.g., assert tx.set_memo("test") is tx).
  • Assert backward-compatible defaults are maintained.
  • If a breaking change is introduced, tests must assert deprecation behavior and test old behavior until removal.

PRIORITY 2 - Constructor & Setter Behavior:

  • Test constructor behavior with valid inputs, edge cases, and invalid inputs.
  • Test setter behavior including method chaining (fluent interface).
  • Verify that setters validate input and raise appropriate exceptions.
  • Test that getters return expected values after construction/setting.

PRIORITY 3 - Comprehensive Coverage:

  • Unit tests should be extensive - test even if we don't expect users to use it currently.
  • Cover happy paths AND unhappy paths/edge cases.
  • Test boundary conditions, null/None values, empty collections, etc.
  • Avoid brittle ordering assertions unless order is part of the contract.

PRIORITY 4 - No Mocks for Non-Existent Modules:

  • All imports must reference actual SDK modules - no hallucinated paths.
  • Validate import paths against the actual src/hiero_sdk_python structure.
  • Mocks should only be used for external de...

Files:

  • tests/unit/account_create_transaction_test.py
  • tests/unit/executable_test.py
docs/**

⚙️ CodeRabbit configuration file

docs/**: You are reviewing documentation for the Hiero Python SDK. These pages serve both SDK users and SDK developers.

Priority 1 - Correctness (code, commands, links)

  1. Verify code snippets conceptually run and match the current SDK API.
  2. Check shell commands and workflow steps against actual project tooling.
  3. Validate URLs and cross-references; flag broken or misleading links.

Priority 2 - Clarity and completeness

  1. Ensure each page states its purpose and expected outcome early.
  2. Prefer concrete, step-wise explanations over vague descriptions.
  3. Highlight missing prerequisites that would block a reader.
  4. For larger gaps, suggest filing a follow-up issue instead of blocking.

Priority 3 - Consistency and navigation

  1. Encourage consistent terminology with the SDK and examples.
  2. Check headings form a logical reading path.
  3. Confirm each page makes clear which audience it serves.

PHILOSOPHY

  • Treat docs as work-in-progress: optimize for correctness and clarity over perfection.
  • Keep feedback concise, action-oriented, and focused on reader success.
  • Do not request large-scale restructures unless current structure blocks understanding.

AVOID

  • Avoid lint-style feedback on Markdown formatting or minor wording.
  • Avoid proposing new conventions without clear benefit.
  • Avoid turning every high-level gap into a blocker.

Files:

  • docs/sdk_users/running_examples.md
docs/sdk_users/**

⚙️ CodeRabbit configuration file

docs/sdk_users/**: These documents are for SDK users who want to USE the Hiero Python SDK quickly and correctly.

Priority 1 - High-level guidance

  1. Ensure explanations are conceptual and point to /examples for runnable code.
  2. Check that required environment variables and network choices are clearly stated.

Priority 2 - No hidden assumptions

  1. Assume zero prior knowledge of this SDK and minimal Hedera background.
  2. Avoid requiring knowledge of repository layout or contribution workflow.

PHILOSOPHY

  • Keep explanations high-level and conceptual; defer runnable examples to /examples.
  • Focus on what users need to know before diving into code examples.

Files:

  • docs/sdk_users/running_examples.md
🧬 Code graph analysis (50)
examples/tokens/token_reject_transaction_fungible_token.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_create_transaction_kyc_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/token_grant_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_wipe_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/schedule/schedule_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_allowance_approve_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/transaction/transfer_transaction_fungible.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/integration/token_update_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/schedule/schedule_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_airdrop_claim_auto.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_create_transaction_freeze_key.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/integration/batch_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (2)
  • set_key_without_alias (94-107)
  • AccountCreateTransaction (27-380)
src/hiero_sdk_python/transaction/transaction.py (1)
  • batchify (825-840)
examples/tokens/token_associate_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_allowance_delete_transaction_nft.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/query/transaction_record_query.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/unit/account_create_transaction_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (4)
  • set_key_without_alias (94-107)
  • set_key_with_alias (109-135)
  • AccountCreateTransaction (27-380)
  • set_alias (220-244)
examples/tokens/account_allowance_approve_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/token_revoke_kyc_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_airdrop_transaction.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_airdrop_transaction_cancel.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/logger/logging_example.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/integration/transaction_record_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/transaction/transfer_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/query/account_balance_query_2.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_allowance_approve_transaction_nft.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/integration/account_update_transaction_e2e_test.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_create_transaction_pause_key.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_airdrop_claim_signature_required.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_delete_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/schedule/schedule_sign_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/consensus/topic_create_transaction_revenue_generating.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/account/account_allowance_delete_transaction_hbar.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/unit/executable_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/revenue_generating_topics_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/integration/token_reject_transaction_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (2)
  • set_key_without_alias (94-107)
  • AccountCreateTransaction (27-380)
tests/integration/account_info_query_e2e_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_create_transaction_max_automatic_token_associations_0.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
tests/integration/utils.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/query/account_info_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/transaction/transfer_transaction_hbar.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/account/account_update_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_reject_transaction_nft.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_create_transaction_wipe_key.py (3)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
tests/unit/conftest.py (1)
  • private_key (54-56)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/tokens/token_dissociate_transaction.py (2)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
src/hiero_sdk_python/crypto/private_key.py (1)
  • public_key (305-309)
examples/account/account_records_query.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_grant_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/tokens/token_revoke_kyc_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
examples/schedule/schedule_create_transaction.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (1)
  • set_key_without_alias (94-107)
🪛 Ruff (0.14.10)
tests/unit/account_create_transaction_test.py

388-388: pytest.raises(ValueError) is too broad, set the match parameter or use a more specific exception

(PT011)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: build-and-test (3.11)
  • GitHub Check: build-and-test (3.13)
  • GitHub Check: build-and-test (3.12)
  • GitHub Check: build-and-test (3.10)
  • GitHub Check: run-examples
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (47)
examples/tokens/token_airdrop_transaction_cancel.py (1)

56-61: LGTM! Correct replacement of deprecated method.

The change from set_key() to set_key_without_alias() correctly replaces the deprecated method. Since no alias is involved in this account creation, set_key_without_alias() is the appropriate choice. The transaction lifecycle is correct: construct → freeze_with → sign → execute.

examples/transaction/transfer_transaction_fungible.py (1)

59-59: LGTM! Correct replacement of deprecated method.

The change from set_key() to set_key_without_alias() correctly addresses the deprecation issue. The method exists in the SDK, accepts the correct Key type, and the transaction lifecycle (construction → freeze_with → sign → execute) is properly maintained.

tests/integration/revenue_generating_topics_e2e_test.py (2)

529-534: LGTM! Correct API replacement.

The change from set_key() to set_key_without_alias() correctly applies the new API for account creation without aliasing.


592-597: LGTM! Consistent with the first replacement.

The API change is correctly applied for the second fee-exempt account creation.

examples/logger/logging_example.py (1)

110-116: LGTM! Correct lifecycle and API usage.

The replacement of set_key() with set_key_without_alias() is correct, and the transaction follows proper SDK lifecycle with freeze_with(client) before signing.

examples/tokens/token_airdrop_claim_signature_required.py (1)

99-108: LGTM! Complete transaction lifecycle.

The API change to set_key_without_alias() is correct, and the transaction properly follows the SDK pattern: construct → freeze_with → sign → execute.

examples/tokens/token_wipe_transaction.py (1)

53-60: LGTM! Proper transaction lifecycle.

The change from set_key() to set_key_without_alias() is correct, and freeze_with(client) is called before execution as required by SDK best practices.

examples/account/account_allowance_approve_transaction_nft.py (1)

86-86: LGTM! Correct replacement of deprecated method.

The change from set_key() to set_key_without_alias() correctly addresses the deprecation. The method call is properly integrated into the account creation flow.

examples/schedule/schedule_sign_transaction.py (1)

59-59: LGTM! Correct replacement with proper transaction lifecycle.

The change from set_key() to set_key_without_alias() correctly addresses the deprecation. The transaction demonstrates best practices with explicit freeze_withsignexecute sequence.

examples/query/transaction_get_receipt_query.py (1)

52-52: LGTM! Correct replacement of deprecated method.

The change from set_key() to set_key_without_alias() properly addresses the deprecation. The transaction lifecycle on line 55 correctly applies freeze_withsignexecute.

CHANGELOG.md (1)

146-147: LGTM! Clear and accurate changelog entry.

The changelog entry correctly documents the replacement of the deprecated set_key() method across examples and tests. The description is concise and properly categorized.

examples/tokens/token_airdrop_claim_auto.py (1)

90-99: LGTM! Correct usage of set_key_without_alias with proper transaction lifecycle.

The replacement of set_key with set_key_without_alias is correct and aligns with the SDK API update. The transaction follows the required lifecycle: construction → freeze_with → sign → execute.

examples/account/account_records_query.py (1)

48-55: LGTM! Correct usage of set_key_without_alias with proper transaction lifecycle.

The replacement of set_key with set_key_without_alias is correct and aligns with the SDK API update. The transaction follows the required lifecycle: construction → freeze_with → execute.

examples/tokens/token_create_transaction_pause_key.py (1)

188-212: LGTM!

The replacement of set_key() with set_key_without_alias() is correct. The transaction follows the proper lifecycle: construction → freeze_with → sign → execute. The inline comment clarifying that a public key must be used is helpful for users copying this example.

examples/schedule/schedule_delete_transaction.py (1)

46-70: LGTM!

The replacement of set_key() with set_key_without_alias() is correct, and the transaction follows the proper lifecycle: construction → freeze_with → sign → execute. Response validation correctly checks for ResponseCode.SUCCESS.

examples/query/account_info_query.py (1)

50-74: LGTM!

The replacement of set_key() with set_key_without_alias() is correct, and the transaction follows the proper lifecycle: construction → freeze_with → sign → execute. Response validation and error handling are appropriate for an example script.

examples/tokens/token_create_transaction_freeze_key.py (1)

177-196: LGTM!

The replacement of set_key() with set_key_without_alias() is correct, and the transaction follows the proper lifecycle: construction → freeze_with → sign → execute. The account creation is properly integrated into the freeze key demonstration flow.

examples/tokens/token_reject_transaction_fungible_token.py (1)

57-57: LGTM: Correct replacement of deprecated method.

The change from set_key() to set_key_without_alias() correctly replaces the deprecated method with the non-aliasing variant, as intended by this PR.

docs/sdk_users/running_examples.md (1)

123-123: LGTM: Documentation correctly updated.

The documentation example now uses set_key_without_alias(), accurately reflecting the current SDK API and helping users adopt the non-deprecated method.

tests/integration/account_update_transaction_e2e_test.py (1)

28-28: LGTM: Correct replacement of deprecated method.

These lines correctly replace set_key() with set_key_without_alias(), aligning with the PR objective.

Also applies to: 104-104, 142-142, 341-341, 351-351

examples/tokens/token_grant_kyc_transaction.py (1)

108-108: LGTM: Correct replacement of deprecated method.

The change from set_key() to set_key_without_alias() correctly replaces the deprecated method. The transaction lifecycle is also properly maintained with freeze_with(client) included.

examples/account/account_update_transaction.py (1)

47-47: LGTM: Correct replacement of deprecated method.

The change from set_key() to set_key_without_alias() correctly replaces the deprecated method. The transaction lifecycle is properly maintained with freeze_with(), sign(), and execute() included.

examples/tokens/token_create_transaction_kyc_key.py (1)

94-94: LGTM - Correct replacement of deprecated method.

The change from set_key() to set_key_without_alias() is correct and aligns with the SDK's updated API. The transaction lifecycle remains intact with proper ordering: freeze → sign → execute.

examples/schedule/schedule_info_query.py (1)

52-52: LGTM - Correct usage of new API method.

The replacement of set_key() with set_key_without_alias() is correct. The account creation flow follows the proper transaction lifecycle with freeze_with → sign → execute.

examples/account/account_delete_transaction.py (1)

27-27: LGTM - Proper API migration.

The change from set_key() to set_key_without_alias() correctly uses the non-deprecated API. Transaction chain is properly ordered.

examples/schedule/schedule_create_transaction.py (1)

48-48: LGTM - Deprecated method replaced correctly.

The replacement with set_key_without_alias() is correct. The account creation follows the proper transaction lifecycle and will work correctly in the scheduled transaction demonstration.

tests/integration/account_info_query_e2e_test.py (1)

31-31: LGTM - Integration test updated correctly.

The change from set_key() to set_key_without_alias() properly updates the test to use the non-deprecated API. The test correctly validates that the key is set as expected (line 43).

tests/integration/token_revoke_kyc_transaction_e2e_test.py (3)

23-23: LGTM: Correct API replacement.

The replacement of set_key with set_key_without_alias is correct and aligns with the SDK's updated public API.


75-75: LGTM: Correct API replacement.

The replacement of set_key with set_key_without_alias is correct and consistent with the other account creation flows in this test file.


127-127: LGTM: Correct API replacement.

The replacement of set_key with set_key_without_alias is correct. All three test functions in this file now consistently use the non-deprecated API.

examples/account/account_allowance_delete_transaction_nft.py (1)

73-73: LGTM: Correct API replacement.

The replacement of set_key with set_key_without_alias is correct and aligns with the SDK's updated public API.

examples/account/account_create_transaction.py (1)

78-78: LGTM: Correct API replacement with proper transaction lifecycle.

The replacement of set_key with set_key_without_alias is correct. This example also demonstrates the proper transaction lifecycle (construction → freeze_with → sign → execute at line 85), making it a good reference for users.

tests/unit/executable_test.py (1)

55-55: LGTM: Correct API replacements across all unit tests.

All nine occurrences correctly replace set_key with set_key_without_alias. The changes are mechanical and don't affect the test logic—each test continues to validate its intended executable behavior (retry logic, node switching, error handling, etc.).

Also applies to: 78-78, 118-118, 155-155, 191-191, 222-222, 256-256, 294-294, 410-410

examples/account/account_allowance_approve_transaction_hbar.py (1)

68-74: LGTM - API migration applied correctly.

The replacement of set_key() with set_key_without_alias() is correct. The transaction lifecycle is valid for operator-paid account creation.

tests/integration/query_e2e_test.py (1)

23-28: LGTM - Consistent API migration across all test cases.

All five test functions correctly replace set_key() with set_key_without_alias(). The transaction lifecycle and assertions are proper.

Also applies to: 73-78, 130-135, 169-174, 215-220

examples/tokens/token_create_transaction_max_automatic_token_associations_0.py (1)

93-101: LGTM - Exemplary transaction lifecycle.

The API migration to set_key_without_alias() is correct. The explicit freeze_with(client) -> sign(operator_key) -> execute(client) chain demonstrates best practices for SDK examples.

tests/integration/token_reject_transaction_e2e_test.py (1)

115-117: LGTM - API migration applied correctly across test cases.

All four occurrences correctly replace set_key() with set_key_without_alias(). The transaction lifecycle is appropriate for each context:

  • Lines 115-117, 177, 903: Simple operator-paid account creation
  • Lines 883-885: Properly uses freeze_with() -> sign() for receiver-signature-required account

Also applies to: 177-177, 883-885, 903-903

examples/tokens/token_airdrop_transaction.py (1)

57-64: LGTM - Proper transaction lifecycle and API migration.

The replacement of set_key() with set_key_without_alias() is correct. The explicit freeze_with() -> sign() -> execute() chain demonstrates SDK best practices for examples.

examples/tokens/token_associate_transaction.py (1)

78-78: LGTM: Correctly replaced deprecated method.

The change from set_key() to set_key_without_alias() properly aligns with the SDK's deprecation path. The method accepts the public key and correctly sets no alias for this account creation flow.

examples/transaction/transfer_transaction_nft.py (1)

59-59: LGTM: Deprecation fix applied correctly.

The replacement of set_key() with set_key_without_alias() is correct. The public key is properly passed to the new method.

examples/query/transaction_record_query.py (1)

57-57: LGTM: Correctly migrated to non-deprecated API.

The change from set_key() to set_key_without_alias() is correct. The chained public_key() call properly derives the public key from the private key.

examples/account/account_allowance_delete_transaction_hbar.py (1)

43-43: LGTM: Deprecation replacement is correct.

The updated method set_key_without_alias() properly replaces the deprecated set_key(). The public key parameter is correctly passed.

examples/transaction/transfer_transaction_hbar.py (1)

56-56: LGTM: Correct replacement of deprecated method.

The change from set_key() to set_key_without_alias() is correct. This example properly demonstrates the complete transaction lifecycle (construct → freeze → sign → execute) with the updated API.

tests/integration/batch_transaction_e2e_test.py (1)

280-301: LGTM! Correct replacement of deprecated method.

All three set_key_without_alias() calls correctly replace the deprecated set_key() method. The test logic is sound: it validates that successful inner transactions incur fees even when one transaction fails due to missing signatures. The transaction lifecycle (batchify → BatchTransaction.execute) and assertions are appropriate for this integration test.

examples/tokens/token_revoke_kyc_transaction.py (1)

109-114: LGTM! Correct replacement of deprecated method.

The set_key_without_alias(new_account_public_key) call correctly replaces the deprecated set_key() method. The transaction lifecycle (construct → freeze_with → execute) is proper, and the response validation is appropriate.

tests/integration/transaction_record_query_e2e_test.py (1)

23-28: LGTM! Correct replacement of deprecated method.

The set_key_without_alias(new_account_public_key) call correctly replaces the deprecated set_key() method. The test properly validates account creation and subsequently queries the transaction record with appropriate assertions.

tests/unit/account_create_transaction_test.py (1)

188-193: LGTM! Syntax error has been fixed.

The extra closing parenthesis that was previously flagged on line 192 has been corrected. The code now properly closes the method chain.

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Hi, this is WorkflowBot.
Your pull request cannot be merged as it is not passing all our workflow checks.
Please click on each check to review the logs and resolve issues so all checks pass.
To help you:

@AntonioCeppellini
Copy link
Member

If anyone is available to help see why the unit tests have failed, is there a change in this PR or do we have a general bug? @hiero-ledger/hiero-sdk-python-triage https://github.com/hiero-ledger/hiero-sdk-python/actions/runs/20758275496/job/59606244655?pr=1355

hi @exploreriii, i saw this but i could be wrong, i'm a bit in a rush...
the failing tests are calling set_key_with_alias() with an Ed25519 key (generated via PrivateKey.generate()), but set_key_with_alias() attempts to derive an EVM address, which is only valid for ECDSA/secp256k1 keys.
this now correctly raises: ValueError: Cannot derive an EVM address from an Ed25519 key.
in the passing tests, set_key_with_alias() is only used with ECDSA keys (or with a separate ECDSA alias key), which is the valid case

@github-actions
Copy link

github-actions bot commented Jan 6, 2026

Hi, this is MergeConflictBot.
Your pull request cannot be merged because it contains merge conflicts.

Please resolve these conflicts locally and push the changes.

To assist you, please read:

Thank you for contributing!

Copy link
Contributor

@manishdait manishdait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use set_key_without_alias() instead of set_key_with_alias().

@exploreriii exploreriii marked this pull request as draft January 8, 2026 00:41
@prishajaiswal75
Copy link
Contributor Author

If anyone is available to help see why the unit tests have failed, is there a change in this PR or do we have a general bug? @hiero-ledger/hiero-sdk-python-triage
https://github.com/hiero-ledger/hiero-sdk-python/actions/runs/20758275496/job/59606244655?pr=1355

Should i try adding freeze where the code rabblit is suggesting ?

@prishajaiswal75
Copy link
Contributor Author

Use set_key_without_alias() instead of set_key_with_alias().

okayy i would

Changed from with to without 

Signed-off-by: prishajaiswal75 <[email protected]>
@exploreriii
Copy link
Contributor

Hi, sorry about the freeze thing -
Coderabbit is commiting out of the scope of PRs - we've been trying to fix this 👍
The freeze might be nice to have in some cases but is not required in many cases, as execute does it anyway - sometimes it helps to have it in because it is clearer
I'd recommend to ignore it, we can set up a new issue later.

@exploreriii
Copy link
Contributor

Hi @prishajaiswal75 please rebase, accept both changes and I think this is good to go 👍

@prishajaiswal75
Copy link
Contributor Author

Hi @prishajaiswal75 please rebase, accept both changes and I think this is good to go 👍

okayy

@prishajaiswal75 prishajaiswal75 marked this pull request as ready for review January 8, 2026 17:14
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/unit/account_create_transaction_test.py (1)

374-389: Consider adding match parameter to pytest.raises for more specific validation.

The test correctly validates that invalid alias strings raise ValueError. For improved test specificity, consider adding a match parameter to validate the error message:

with pytest.raises(ValueError, match="invalid.*alias"):
    tx.set_alias(invalid_str)

This would catch cases where a ValueError is raised for an unexpected reason.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eaa39d9 and 1c0c3a9.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • tests/unit/account_create_transaction_test.py
🧰 Additional context used
📓 Path-based instructions (1)
tests/unit/**/*

⚙️ CodeRabbit configuration file

tests/unit/**/*: You are acting as a senior maintainer reviewing unit tests for the hiero-sdk-python project. Your goal is to ensure tests are extensive, deterministic, and protect against breaking changes.

CRITICAL PRINCIPLES - Tests Must Fail Loudly & Deterministically:

  • Tests must provide useful error messages when they fail for future debugging.
  • No print() statements - use assertions with descriptive messages.
  • No timing-dependent or unseeded random assertions.
  • No network calls or external dependencies (unit tests are isolated).
  • No unjustified TODOs or skipped tests without tracking issues.

PRIORITY 1 - Protect Against Breaking Changes:

  • Assert public attributes exist (e.g., assert hasattr(obj, 'account_id')).
  • Assert return types where relevant (e.g., assert isinstance(result, AccountId)).
  • Assert fluent setters return self (e.g., assert tx.set_memo("test") is tx).
  • Assert backward-compatible defaults are maintained.
  • If a breaking change is introduced, tests must assert deprecation behavior and test old behavior until removal.

PRIORITY 2 - Constructor & Setter Behavior:

  • Test constructor behavior with valid inputs, edge cases, and invalid inputs.
  • Test setter behavior including method chaining (fluent interface).
  • Verify that setters validate input and raise appropriate exceptions.
  • Test that getters return expected values after construction/setting.

PRIORITY 3 - Comprehensive Coverage:

  • Unit tests should be extensive - test even if we don't expect users to use it currently.
  • Cover happy paths AND unhappy paths/edge cases.
  • Test boundary conditions, null/None values, empty collections, etc.
  • Avoid brittle ordering assertions unless order is part of the contract.

PRIORITY 4 - No Mocks for Non-Existent Modules:

  • All imports must reference actual SDK modules - no hallucinated paths.
  • Validate import paths against the actual src/hiero_sdk_python structure.
  • Mocks should only be used for external de...

Files:

  • tests/unit/account_create_transaction_test.py
🧠 Learnings (1)
📓 Common learnings
Learnt from: github-actions[bot]
Repo: hiero-ledger/hiero-sdk-python PR: 0
File: :0-0
Timestamp: 2026-01-08T10:28:14.391Z
Learning: In hiero-ledger/hiero-sdk-python, examples should prefer Client.from_env() (src/hiero_sdk_python/client/client.py) for client setup. For examples under examples/tokens, replace manual Network/AccountId/PrivateKey + load_dotenv() bootstrapping with Client.from_env(), and use client.operator_account_id and client.operator_private_key instead of passing operator_id/operator_key through functions.
🧬 Code graph analysis (1)
tests/unit/account_create_transaction_test.py (1)
src/hiero_sdk_python/account/account_create_transaction.py (3)
  • set_key_without_alias (94-107)
  • AccountCreateTransaction (27-380)
  • set_alias (220-244)
🪛 Ruff (0.14.10)
tests/unit/account_create_transaction_test.py

388-388: pytest.raises(ValueError) is too broad, set the match parameter or use a more specific exception

(PT011)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (4)
CHANGELOG.md (1)

153-154: LGTM! Changelog entry accurately documents the deprecation replacement.

The changelog entry clearly describes the replacement of deprecated set_key() usage across examples and tests with the new methods. The scope and nature of the change are well documented.

tests/unit/account_create_transaction_test.py (3)

45-45: LGTM! Correct replacement of deprecated method across basic account creation tests.

All basic account creation tests correctly replace set_key() with set_key_without_alias(), which is appropriate for these scenarios where no alias functionality is required. The method chaining and test behavior are preserved.

Also applies to: 70-70, 105-105, 170-170, 190-190, 237-237


334-335: LGTM! Correct usage pattern for testing independent alias setting.

These tests correctly use set_key_without_alias() followed by separate set_alias() calls, which validates the independent alias-setting API. This pattern is appropriate for testing the set_alias() method in isolation.

Also applies to: 360-361, 386-386, 394-394


505-525: LGTM! Important test validates alias clearing behavior.

This test correctly verifies that set_key_without_alias() clears any previously set alias, which is the expected behavior documented in the method contract. The assertion at line 525 confirms the alias is properly set to None.

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1355      +/-   ##
==========================================
- Coverage   92.44%   92.40%   -0.05%     
==========================================
  Files         139      139              
  Lines        8528     8528              
==========================================
- Hits         7884     7880       -4     
- Misses        644      648       +4     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@manishdait manishdait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good to me

@manishdait manishdait requested a review from a team January 8, 2026 18:52
Copy link
Contributor

@aceppaluni aceppaluni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@prishajaiswal75 Super great work!!

@exploreriii
Copy link
Contributor

Congratulations !
thanks for updating all the examples and tests

@exploreriii exploreriii merged commit ea81547 into hiero-ledger:main Jan 8, 2026
19 checks passed
@exploreriii
Copy link
Contributor

exploreriii commented Jan 8, 2026

Thank you for your help Manish and Antonio and Aceppaluni

aceppaluni pushed a commit to aceppaluni/hiero-sdk-python that referenced this pull request Jan 9, 2026
@prishajaiswal75
Copy link
Contributor Author

prishajaiswal75 commented Jan 9, 2026

Congratulations ! thanks for updating all the examples and tests

Thank you :) i would really like to contribute more in order to learn further which kind of PRS should i now pick up considering i am an AIML student are there any repos which i can try as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Intermediate]: Refactor uses of deprecated set_key method for set_key_without_alias

5 participants